diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/DataCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/MatchCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/10ScopesAndTypes/types/context/ApplicationContext.d.ts b/TypeScript/10ScopesAndTypes/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/10ScopesAndTypes/types/context/ApplicationContext.d.ts +++ b/TypeScript/10ScopesAndTypes/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/AchievementController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/AchievementController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/10ScopesAndTypes/types/controllers/BuildController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/BuildController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/10ScopesAndTypes/types/controllers/CustomizationController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/CustomizationController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/10ScopesAndTypes/types/controllers/DialogueController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/DialogueController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InraidController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InraidController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/10ScopesAndTypes/types/controllers/LocationController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/LocationController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/10ScopesAndTypes/types/controllers/PresetController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/PresetController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RepairController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RepairController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/10ScopesAndTypes/types/controllers/TradeController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/TradeController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/10ScopesAndTypes/types/controllers/TraderController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/TraderController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/10ScopesAndTypes/types/di/Container.d.ts b/TypeScript/10ScopesAndTypes/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/10ScopesAndTypes/types/di/Container.d.ts +++ b/TypeScript/10ScopesAndTypes/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotInventoryGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotLevelGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotWeaponGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/10ScopesAndTypes/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/10ScopesAndTypes/types/generators/LocationGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/LocationGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/10ScopesAndTypes/types/generators/PMCLootGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/10ScopesAndTypes/types/generators/PlayerScavGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/10ScopesAndTypes/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/10ScopesAndTypes/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/10ScopesAndTypes/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/10ScopesAndTypes/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/10ScopesAndTypes/types/helpers/BotHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/BotHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/10ScopesAndTypes/types/helpers/ContainerHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HandbookHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/10ScopesAndTypes/types/helpers/RagfairHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/10ScopesAndTypes/types/helpers/RagfairSellHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/10ScopesAndTypes/types/helpers/RagfairServerHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/10ScopesAndTypes/types/helpers/TraderAssortHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/bots/IBots.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/10ScopesAndTypes/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/10ScopesAndTypes/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/10ScopesAndTypes/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/hideout/IHideout.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/templates/ITemplates.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts b/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/10ScopesAndTypes/types/servers/SaveServer.d.ts b/TypeScript/10ScopesAndTypes/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/10ScopesAndTypes/types/servers/SaveServer.d.ts +++ b/TypeScript/10ScopesAndTypes/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/10ScopesAndTypes/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/10ScopesAndTypes/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/10ScopesAndTypes/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/10ScopesAndTypes/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts b/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/10ScopesAndTypes/types/services/BotLootCacheService.d.ts b/TypeScript/10ScopesAndTypes/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/10ScopesAndTypes/types/services/BotLootCacheService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/10ScopesAndTypes/types/services/DatabaseService.d.ts b/TypeScript/10ScopesAndTypes/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/10ScopesAndTypes/types/services/GiftService.d.ts b/TypeScript/10ScopesAndTypes/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/10ScopesAndTypes/types/services/GiftService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/10ScopesAndTypes/types/services/InsuranceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/10ScopesAndTypes/types/services/InsuranceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/10ScopesAndTypes/types/services/ItemBaseClassService.d.ts b/TypeScript/10ScopesAndTypes/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/10ScopesAndTypes/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts b/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/10ScopesAndTypes/types/services/PaymentService.d.ts b/TypeScript/10ScopesAndTypes/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/10ScopesAndTypes/types/services/PaymentService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/services/PmcChatResponseService.d.ts b/TypeScript/10ScopesAndTypes/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/10ScopesAndTypes/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts b/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/10ScopesAndTypes/types/services/ProfileSnapshotService.d.ts b/TypeScript/10ScopesAndTypes/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/10ScopesAndTypes/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/10ScopesAndTypes/types/services/RagfairOfferService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RagfairOfferService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/10ScopesAndTypes/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/10ScopesAndTypes/types/services/SeasonalEventService.d.ts b/TypeScript/10ScopesAndTypes/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/10ScopesAndTypes/types/services/SeasonalEventService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/10ScopesAndTypes/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/10ScopesAndTypes/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/10ScopesAndTypes/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/10ScopesAndTypes/types/services/mod/CustomItemService.d.ts b/TypeScript/10ScopesAndTypes/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/10ScopesAndTypes/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/10ScopesAndTypes/types/utils/HttpResponseUtil.d.ts b/TypeScript/10ScopesAndTypes/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/10ScopesAndTypes/types/utils/JsonUtil.d.ts b/TypeScript/10ScopesAndTypes/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/JsonUtil.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/10ScopesAndTypes/types/utils/MathUtil.d.ts b/TypeScript/10ScopesAndTypes/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/MathUtil.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/10ScopesAndTypes/types/utils/RagfairOfferHolder.d.ts b/TypeScript/10ScopesAndTypes/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/10ScopesAndTypes/types/utils/RandomUtil.d.ts b/TypeScript/10ScopesAndTypes/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/RandomUtil.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/10ScopesAndTypes/types/utils/TimeUtil.d.ts b/TypeScript/10ScopesAndTypes/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/TimeUtil.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/10ScopesAndTypes/types/utils/VFS.d.ts b/TypeScript/10ScopesAndTypes/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/VFS.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/10ScopesAndTypes/types/utils/Watermark.d.ts b/TypeScript/10ScopesAndTypes/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/Watermark.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/10ScopesAndTypes/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/10ScopesAndTypes/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/10ScopesAndTypes/types/utils/collections/queue/Queue.d.ts b/TypeScript/10ScopesAndTypes/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/DataCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/MatchCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/11BundleLoadingSample/types/context/ApplicationContext.d.ts b/TypeScript/11BundleLoadingSample/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/11BundleLoadingSample/types/context/ApplicationContext.d.ts +++ b/TypeScript/11BundleLoadingSample/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/AchievementController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/AchievementController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/11BundleLoadingSample/types/controllers/BuildController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/BuildController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/11BundleLoadingSample/types/controllers/CustomizationController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/CustomizationController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/11BundleLoadingSample/types/controllers/DialogueController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/DialogueController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InraidController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InraidController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/11BundleLoadingSample/types/controllers/LocationController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/LocationController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/11BundleLoadingSample/types/controllers/PresetController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/PresetController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/ProfileController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/ProfileController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/11BundleLoadingSample/types/controllers/RepairController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/RepairController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/11BundleLoadingSample/types/controllers/TradeController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/TradeController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/11BundleLoadingSample/types/controllers/TraderController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/TraderController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/11BundleLoadingSample/types/di/Container.d.ts b/TypeScript/11BundleLoadingSample/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/11BundleLoadingSample/types/di/Container.d.ts +++ b/TypeScript/11BundleLoadingSample/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotInventoryGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotLevelGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotWeaponGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/11BundleLoadingSample/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/11BundleLoadingSample/types/generators/LocationGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/LocationGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/11BundleLoadingSample/types/generators/PMCLootGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/11BundleLoadingSample/types/generators/PlayerScavGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/11BundleLoadingSample/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/11BundleLoadingSample/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/11BundleLoadingSample/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/11BundleLoadingSample/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/11BundleLoadingSample/types/helpers/BotHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/BotHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/11BundleLoadingSample/types/helpers/ContainerHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/HandbookHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/11BundleLoadingSample/types/helpers/RagfairHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/11BundleLoadingSample/types/helpers/RagfairSellHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/11BundleLoadingSample/types/helpers/RagfairServerHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/11BundleLoadingSample/types/helpers/TraderAssortHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/bots/IBots.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/11BundleLoadingSample/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/11BundleLoadingSample/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/11BundleLoadingSample/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/hideout/IHideout.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/templates/ITemplates.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/11BundleLoadingSample/types/routers/EventOutputHolder.d.ts b/TypeScript/11BundleLoadingSample/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/11BundleLoadingSample/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/11BundleLoadingSample/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/11BundleLoadingSample/types/servers/SaveServer.d.ts b/TypeScript/11BundleLoadingSample/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/11BundleLoadingSample/types/servers/SaveServer.d.ts +++ b/TypeScript/11BundleLoadingSample/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/11BundleLoadingSample/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/11BundleLoadingSample/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/11BundleLoadingSample/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/11BundleLoadingSample/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/11BundleLoadingSample/types/services/BotEquipmentFilterService.d.ts b/TypeScript/11BundleLoadingSample/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/11BundleLoadingSample/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/11BundleLoadingSample/types/services/BotLootCacheService.d.ts b/TypeScript/11BundleLoadingSample/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/11BundleLoadingSample/types/services/BotLootCacheService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/11BundleLoadingSample/types/services/DatabaseService.d.ts b/TypeScript/11BundleLoadingSample/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts b/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/11BundleLoadingSample/types/services/GiftService.d.ts b/TypeScript/11BundleLoadingSample/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/11BundleLoadingSample/types/services/GiftService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/11BundleLoadingSample/types/services/InsuranceService.d.ts b/TypeScript/11BundleLoadingSample/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/11BundleLoadingSample/types/services/InsuranceService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/11BundleLoadingSample/types/services/ItemBaseClassService.d.ts b/TypeScript/11BundleLoadingSample/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/11BundleLoadingSample/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts b/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/11BundleLoadingSample/types/services/PaymentService.d.ts b/TypeScript/11BundleLoadingSample/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/11BundleLoadingSample/types/services/PaymentService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/services/PmcChatResponseService.d.ts b/TypeScript/11BundleLoadingSample/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/11BundleLoadingSample/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts b/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/11BundleLoadingSample/types/services/ProfileSnapshotService.d.ts b/TypeScript/11BundleLoadingSample/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/11BundleLoadingSample/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/11BundleLoadingSample/types/services/RagfairOfferService.d.ts b/TypeScript/11BundleLoadingSample/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/11BundleLoadingSample/types/services/RagfairOfferService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/11BundleLoadingSample/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/11BundleLoadingSample/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/11BundleLoadingSample/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/11BundleLoadingSample/types/services/SeasonalEventService.d.ts b/TypeScript/11BundleLoadingSample/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/11BundleLoadingSample/types/services/SeasonalEventService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/11BundleLoadingSample/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/11BundleLoadingSample/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/11BundleLoadingSample/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/11BundleLoadingSample/types/services/mod/CustomItemService.d.ts b/TypeScript/11BundleLoadingSample/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/11BundleLoadingSample/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/11BundleLoadingSample/types/utils/HttpResponseUtil.d.ts b/TypeScript/11BundleLoadingSample/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/11BundleLoadingSample/types/utils/JsonUtil.d.ts b/TypeScript/11BundleLoadingSample/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/JsonUtil.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/11BundleLoadingSample/types/utils/MathUtil.d.ts b/TypeScript/11BundleLoadingSample/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/MathUtil.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/11BundleLoadingSample/types/utils/RagfairOfferHolder.d.ts b/TypeScript/11BundleLoadingSample/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/11BundleLoadingSample/types/utils/RandomUtil.d.ts b/TypeScript/11BundleLoadingSample/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/RandomUtil.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/11BundleLoadingSample/types/utils/TimeUtil.d.ts b/TypeScript/11BundleLoadingSample/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/TimeUtil.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/11BundleLoadingSample/types/utils/VFS.d.ts b/TypeScript/11BundleLoadingSample/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/VFS.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/11BundleLoadingSample/types/utils/Watermark.d.ts b/TypeScript/11BundleLoadingSample/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/Watermark.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/11BundleLoadingSample/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/11BundleLoadingSample/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/11BundleLoadingSample/types/utils/collections/queue/Queue.d.ts b/TypeScript/11BundleLoadingSample/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/DataCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/MatchCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/12ClassExtensionOverride/types/context/ApplicationContext.d.ts b/TypeScript/12ClassExtensionOverride/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/12ClassExtensionOverride/types/context/ApplicationContext.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/AchievementController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/AchievementController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/BuildController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/BuildController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/CustomizationController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/CustomizationController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/DialogueController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/DialogueController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InraidController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InraidController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/LocationController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/LocationController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/PresetController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/PresetController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/ProfileController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/ProfileController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/RepairController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/RepairController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/TradeController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/TradeController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/TraderController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/TraderController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/12ClassExtensionOverride/types/di/Container.d.ts b/TypeScript/12ClassExtensionOverride/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/12ClassExtensionOverride/types/di/Container.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotInventoryGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotLevelGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotWeaponGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/12ClassExtensionOverride/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/12ClassExtensionOverride/types/generators/LocationGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/LocationGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/12ClassExtensionOverride/types/generators/LootGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/LootGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/12ClassExtensionOverride/types/generators/PMCLootGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/12ClassExtensionOverride/types/generators/PlayerScavGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/12ClassExtensionOverride/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/12ClassExtensionOverride/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/BotHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/BotHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/ContainerHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/HandbookHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairSellHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairServerHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/TraderAssortHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/bots/IBots.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/12ClassExtensionOverride/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/12ClassExtensionOverride/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/12ClassExtensionOverride/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/hideout/IHideout.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/templates/ITemplates.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/12ClassExtensionOverride/types/routers/EventOutputHolder.d.ts b/TypeScript/12ClassExtensionOverride/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/12ClassExtensionOverride/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/12ClassExtensionOverride/types/servers/SaveServer.d.ts b/TypeScript/12ClassExtensionOverride/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/12ClassExtensionOverride/types/servers/SaveServer.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/12ClassExtensionOverride/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/12ClassExtensionOverride/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/12ClassExtensionOverride/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/12ClassExtensionOverride/types/services/BotEquipmentFilterService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/12ClassExtensionOverride/types/services/BotLootCacheService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/BotLootCacheService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/12ClassExtensionOverride/types/services/DatabaseService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/12ClassExtensionOverride/types/services/GiftService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/GiftService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/12ClassExtensionOverride/types/services/InsuranceService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/InsuranceService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/12ClassExtensionOverride/types/services/ItemBaseClassService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/12ClassExtensionOverride/types/services/PaymentService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/PaymentService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/services/PmcChatResponseService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/12ClassExtensionOverride/types/services/ProfileSnapshotService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/12ClassExtensionOverride/types/services/RagfairOfferService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/RagfairOfferService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/12ClassExtensionOverride/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/12ClassExtensionOverride/types/services/SeasonalEventService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/SeasonalEventService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/12ClassExtensionOverride/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/12ClassExtensionOverride/types/services/mod/CustomItemService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/12ClassExtensionOverride/types/utils/HttpResponseUtil.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/12ClassExtensionOverride/types/utils/JsonUtil.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/JsonUtil.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/12ClassExtensionOverride/types/utils/MathUtil.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/MathUtil.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/12ClassExtensionOverride/types/utils/RagfairOfferHolder.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/12ClassExtensionOverride/types/utils/RandomUtil.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/RandomUtil.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/12ClassExtensionOverride/types/utils/TimeUtil.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/TimeUtil.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/12ClassExtensionOverride/types/utils/VFS.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/VFS.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/12ClassExtensionOverride/types/utils/Watermark.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/Watermark.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/12ClassExtensionOverride/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/12ClassExtensionOverride/types/utils/collections/queue/Queue.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/13AddTrader/types/callbacks/DataCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/13AddTrader/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/13AddTrader/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/13AddTrader/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/13AddTrader/types/callbacks/MatchCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/13AddTrader/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/13AddTrader/types/context/ApplicationContext.d.ts b/TypeScript/13AddTrader/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/13AddTrader/types/context/ApplicationContext.d.ts +++ b/TypeScript/13AddTrader/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/13AddTrader/types/controllers/AchievementController.d.ts b/TypeScript/13AddTrader/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/13AddTrader/types/controllers/AchievementController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/13AddTrader/types/controllers/BotController.d.ts b/TypeScript/13AddTrader/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/13AddTrader/types/controllers/BotController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/13AddTrader/types/controllers/BuildController.d.ts b/TypeScript/13AddTrader/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/13AddTrader/types/controllers/BuildController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/13AddTrader/types/controllers/CustomizationController.d.ts b/TypeScript/13AddTrader/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/13AddTrader/types/controllers/CustomizationController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/13AddTrader/types/controllers/DialogueController.d.ts b/TypeScript/13AddTrader/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/13AddTrader/types/controllers/DialogueController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/13AddTrader/types/controllers/GameController.d.ts b/TypeScript/13AddTrader/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/13AddTrader/types/controllers/GameController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts b/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/13AddTrader/types/controllers/InraidController.d.ts b/TypeScript/13AddTrader/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/13AddTrader/types/controllers/InraidController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts b/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts b/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts b/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/13AddTrader/types/controllers/LocationController.d.ts b/TypeScript/13AddTrader/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/13AddTrader/types/controllers/LocationController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/13AddTrader/types/controllers/PresetController.d.ts b/TypeScript/13AddTrader/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/13AddTrader/types/controllers/PresetController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/13AddTrader/types/controllers/ProfileController.d.ts b/TypeScript/13AddTrader/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/13AddTrader/types/controllers/ProfileController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/13AddTrader/types/controllers/QuestController.d.ts b/TypeScript/13AddTrader/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/13AddTrader/types/controllers/QuestController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts b/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/13AddTrader/types/controllers/RepairController.d.ts b/TypeScript/13AddTrader/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/13AddTrader/types/controllers/RepairController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts b/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/13AddTrader/types/controllers/TradeController.d.ts b/TypeScript/13AddTrader/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/13AddTrader/types/controllers/TradeController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/13AddTrader/types/controllers/TraderController.d.ts b/TypeScript/13AddTrader/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/13AddTrader/types/controllers/TraderController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/13AddTrader/types/di/Container.d.ts b/TypeScript/13AddTrader/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/13AddTrader/types/di/Container.d.ts +++ b/TypeScript/13AddTrader/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/13AddTrader/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/13AddTrader/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/13AddTrader/types/generators/BotInventoryGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/13AddTrader/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/13AddTrader/types/generators/BotLevelGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/13AddTrader/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/13AddTrader/types/generators/BotWeaponGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/13AddTrader/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/13AddTrader/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/13AddTrader/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/13AddTrader/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/13AddTrader/types/generators/LocationGenerator.d.ts b/TypeScript/13AddTrader/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/13AddTrader/types/generators/LocationGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/13AddTrader/types/generators/LootGenerator.d.ts b/TypeScript/13AddTrader/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/13AddTrader/types/generators/LootGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/13AddTrader/types/generators/PMCLootGenerator.d.ts b/TypeScript/13AddTrader/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/13AddTrader/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/13AddTrader/types/generators/PlayerScavGenerator.d.ts b/TypeScript/13AddTrader/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/13AddTrader/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/13AddTrader/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/13AddTrader/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/13AddTrader/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/13AddTrader/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/13AddTrader/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/13AddTrader/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/13AddTrader/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/13AddTrader/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/13AddTrader/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/13AddTrader/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/13AddTrader/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/13AddTrader/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/13AddTrader/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/13AddTrader/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/13AddTrader/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/13AddTrader/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/13AddTrader/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/13AddTrader/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/13AddTrader/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/13AddTrader/types/helpers/BotHelper.d.ts b/TypeScript/13AddTrader/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/13AddTrader/types/helpers/BotHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/13AddTrader/types/helpers/ContainerHelper.d.ts b/TypeScript/13AddTrader/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/13AddTrader/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/13AddTrader/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/13AddTrader/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/13AddTrader/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/13AddTrader/types/helpers/HandbookHelper.d.ts b/TypeScript/13AddTrader/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/13AddTrader/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts b/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts b/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts b/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts b/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts b/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/13AddTrader/types/helpers/RagfairHelper.d.ts b/TypeScript/13AddTrader/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/13AddTrader/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/13AddTrader/types/helpers/RagfairSellHelper.d.ts b/TypeScript/13AddTrader/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/13AddTrader/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/13AddTrader/types/helpers/RagfairServerHelper.d.ts b/TypeScript/13AddTrader/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/13AddTrader/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/13AddTrader/types/helpers/TraderAssortHelper.d.ts b/TypeScript/13AddTrader/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/13AddTrader/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts b/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/13AddTrader/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/13AddTrader/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/13AddTrader/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/13AddTrader/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/13AddTrader/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/13AddTrader/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/13AddTrader/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/13AddTrader/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/13AddTrader/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/13AddTrader/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/13AddTrader/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/13AddTrader/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/13AddTrader/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/13AddTrader/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/13AddTrader/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/13AddTrader/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/13AddTrader/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/13AddTrader/types/models/spt/bots/IBots.d.ts b/TypeScript/13AddTrader/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/13AddTrader/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/13AddTrader/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/13AddTrader/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/13AddTrader/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/13AddTrader/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/13AddTrader/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/13AddTrader/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/13AddTrader/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/13AddTrader/types/models/spt/hideout/IHideout.d.ts b/TypeScript/13AddTrader/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/13AddTrader/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/13AddTrader/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/13AddTrader/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/13AddTrader/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/13AddTrader/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/13AddTrader/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/13AddTrader/types/models/spt/templates/ITemplates.d.ts b/TypeScript/13AddTrader/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/13AddTrader/types/routers/EventOutputHolder.d.ts b/TypeScript/13AddTrader/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/13AddTrader/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/13AddTrader/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/13AddTrader/types/servers/SaveServer.d.ts b/TypeScript/13AddTrader/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/13AddTrader/types/servers/SaveServer.d.ts +++ b/TypeScript/13AddTrader/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/13AddTrader/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/13AddTrader/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/13AddTrader/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/13AddTrader/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/13AddTrader/types/services/BotEquipmentFilterService.d.ts b/TypeScript/13AddTrader/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/13AddTrader/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/13AddTrader/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/13AddTrader/types/services/BotLootCacheService.d.ts b/TypeScript/13AddTrader/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/13AddTrader/types/services/BotLootCacheService.d.ts +++ b/TypeScript/13AddTrader/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/13AddTrader/types/services/DatabaseService.d.ts b/TypeScript/13AddTrader/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/13AddTrader/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/13AddTrader/types/services/FenceService.d.ts b/TypeScript/13AddTrader/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/13AddTrader/types/services/FenceService.d.ts +++ b/TypeScript/13AddTrader/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/13AddTrader/types/services/GiftService.d.ts b/TypeScript/13AddTrader/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/13AddTrader/types/services/GiftService.d.ts +++ b/TypeScript/13AddTrader/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/13AddTrader/types/services/InsuranceService.d.ts b/TypeScript/13AddTrader/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/13AddTrader/types/services/InsuranceService.d.ts +++ b/TypeScript/13AddTrader/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/13AddTrader/types/services/ItemBaseClassService.d.ts b/TypeScript/13AddTrader/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/13AddTrader/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/13AddTrader/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/13AddTrader/types/services/MailSendService.d.ts b/TypeScript/13AddTrader/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/13AddTrader/types/services/MailSendService.d.ts +++ b/TypeScript/13AddTrader/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/13AddTrader/types/services/PaymentService.d.ts b/TypeScript/13AddTrader/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/13AddTrader/types/services/PaymentService.d.ts +++ b/TypeScript/13AddTrader/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/13AddTrader/types/services/PmcChatResponseService.d.ts b/TypeScript/13AddTrader/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/13AddTrader/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/13AddTrader/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts b/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts +++ b/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/13AddTrader/types/services/ProfileSnapshotService.d.ts b/TypeScript/13AddTrader/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/13AddTrader/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/13AddTrader/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/13AddTrader/types/services/RagfairOfferService.d.ts b/TypeScript/13AddTrader/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/13AddTrader/types/services/RagfairOfferService.d.ts +++ b/TypeScript/13AddTrader/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/13AddTrader/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/13AddTrader/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/13AddTrader/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/13AddTrader/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/13AddTrader/types/services/SeasonalEventService.d.ts b/TypeScript/13AddTrader/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/13AddTrader/types/services/SeasonalEventService.d.ts +++ b/TypeScript/13AddTrader/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/13AddTrader/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/13AddTrader/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/13AddTrader/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/13AddTrader/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/13AddTrader/types/services/mod/CustomItemService.d.ts b/TypeScript/13AddTrader/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/13AddTrader/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/13AddTrader/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/13AddTrader/types/utils/HttpResponseUtil.d.ts b/TypeScript/13AddTrader/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/13AddTrader/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/13AddTrader/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/13AddTrader/types/utils/JsonUtil.d.ts b/TypeScript/13AddTrader/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/13AddTrader/types/utils/JsonUtil.d.ts +++ b/TypeScript/13AddTrader/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/13AddTrader/types/utils/MathUtil.d.ts b/TypeScript/13AddTrader/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/13AddTrader/types/utils/MathUtil.d.ts +++ b/TypeScript/13AddTrader/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/13AddTrader/types/utils/RagfairOfferHolder.d.ts b/TypeScript/13AddTrader/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/13AddTrader/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/13AddTrader/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/13AddTrader/types/utils/RandomUtil.d.ts b/TypeScript/13AddTrader/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/13AddTrader/types/utils/RandomUtil.d.ts +++ b/TypeScript/13AddTrader/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/13AddTrader/types/utils/TimeUtil.d.ts b/TypeScript/13AddTrader/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/13AddTrader/types/utils/TimeUtil.d.ts +++ b/TypeScript/13AddTrader/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/13AddTrader/types/utils/VFS.d.ts b/TypeScript/13AddTrader/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/13AddTrader/types/utils/VFS.d.ts +++ b/TypeScript/13AddTrader/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/13AddTrader/types/utils/Watermark.d.ts b/TypeScript/13AddTrader/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/13AddTrader/types/utils/Watermark.d.ts +++ b/TypeScript/13AddTrader/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/13AddTrader/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/13AddTrader/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/13AddTrader/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/13AddTrader/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/13AddTrader/types/utils/collections/queue/Queue.d.ts b/TypeScript/13AddTrader/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/13AddTrader/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/13AddTrader/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/DataCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/MatchCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/14AfterDBLoadHook/types/context/ApplicationContext.d.ts b/TypeScript/14AfterDBLoadHook/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/14AfterDBLoadHook/types/context/ApplicationContext.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/AchievementController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/AchievementController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/BuildController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/BuildController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/CustomizationController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/CustomizationController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/DialogueController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/DialogueController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InraidController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InraidController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/LocationController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/LocationController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/PresetController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/PresetController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/ProfileController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/ProfileController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/RepairController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/RepairController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/TradeController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/TradeController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/TraderController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/TraderController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/14AfterDBLoadHook/types/di/Container.d.ts b/TypeScript/14AfterDBLoadHook/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/14AfterDBLoadHook/types/di/Container.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotInventoryGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotLevelGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotWeaponGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/14AfterDBLoadHook/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/14AfterDBLoadHook/types/generators/LocationGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/LocationGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/14AfterDBLoadHook/types/generators/LootGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/LootGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/14AfterDBLoadHook/types/generators/PMCLootGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/14AfterDBLoadHook/types/generators/PlayerScavGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/14AfterDBLoadHook/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/14AfterDBLoadHook/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/BotHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/BotHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/ContainerHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/HandbookHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairSellHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairServerHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/TraderAssortHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/bots/IBots.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/14AfterDBLoadHook/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/14AfterDBLoadHook/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/14AfterDBLoadHook/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/hideout/IHideout.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/templates/ITemplates.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/14AfterDBLoadHook/types/routers/EventOutputHolder.d.ts b/TypeScript/14AfterDBLoadHook/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/14AfterDBLoadHook/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/14AfterDBLoadHook/types/servers/SaveServer.d.ts b/TypeScript/14AfterDBLoadHook/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/14AfterDBLoadHook/types/servers/SaveServer.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/14AfterDBLoadHook/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/14AfterDBLoadHook/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/14AfterDBLoadHook/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/14AfterDBLoadHook/types/services/BotEquipmentFilterService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/14AfterDBLoadHook/types/services/BotLootCacheService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/BotLootCacheService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/14AfterDBLoadHook/types/services/DatabaseService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/14AfterDBLoadHook/types/services/GiftService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/GiftService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/14AfterDBLoadHook/types/services/InsuranceService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/InsuranceService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/14AfterDBLoadHook/types/services/ItemBaseClassService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/14AfterDBLoadHook/types/services/PaymentService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/PaymentService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/services/PmcChatResponseService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/14AfterDBLoadHook/types/services/ProfileSnapshotService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/14AfterDBLoadHook/types/services/RagfairOfferService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/RagfairOfferService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/14AfterDBLoadHook/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/14AfterDBLoadHook/types/services/SeasonalEventService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/SeasonalEventService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/14AfterDBLoadHook/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/14AfterDBLoadHook/types/services/mod/CustomItemService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/14AfterDBLoadHook/types/utils/HttpResponseUtil.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/14AfterDBLoadHook/types/utils/JsonUtil.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/JsonUtil.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/14AfterDBLoadHook/types/utils/MathUtil.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/MathUtil.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/14AfterDBLoadHook/types/utils/RagfairOfferHolder.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/14AfterDBLoadHook/types/utils/RandomUtil.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/RandomUtil.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/14AfterDBLoadHook/types/utils/TimeUtil.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/TimeUtil.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/14AfterDBLoadHook/types/utils/VFS.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/VFS.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/14AfterDBLoadHook/types/utils/Watermark.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/Watermark.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/14AfterDBLoadHook/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/14AfterDBLoadHook/types/utils/collections/queue/Queue.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/15HttpListenerExample/types/callbacks/DataCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/15HttpListenerExample/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/15HttpListenerExample/types/callbacks/MatchCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/15HttpListenerExample/types/context/ApplicationContext.d.ts b/TypeScript/15HttpListenerExample/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/15HttpListenerExample/types/context/ApplicationContext.d.ts +++ b/TypeScript/15HttpListenerExample/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/AchievementController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/AchievementController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/15HttpListenerExample/types/controllers/BuildController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/BuildController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/15HttpListenerExample/types/controllers/CustomizationController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/CustomizationController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/15HttpListenerExample/types/controllers/DialogueController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/DialogueController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/15HttpListenerExample/types/controllers/InraidController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/InraidController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/15HttpListenerExample/types/controllers/LocationController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/LocationController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/15HttpListenerExample/types/controllers/PresetController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/PresetController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/ProfileController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/ProfileController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/15HttpListenerExample/types/controllers/RepairController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/RepairController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/15HttpListenerExample/types/controllers/TradeController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/TradeController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/15HttpListenerExample/types/controllers/TraderController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/TraderController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/15HttpListenerExample/types/di/Container.d.ts b/TypeScript/15HttpListenerExample/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/15HttpListenerExample/types/di/Container.d.ts +++ b/TypeScript/15HttpListenerExample/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/15HttpListenerExample/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/15HttpListenerExample/types/generators/BotInventoryGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/15HttpListenerExample/types/generators/BotLevelGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/15HttpListenerExample/types/generators/BotWeaponGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/15HttpListenerExample/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/15HttpListenerExample/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/15HttpListenerExample/types/generators/LocationGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/15HttpListenerExample/types/generators/LocationGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/15HttpListenerExample/types/generators/LootGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/15HttpListenerExample/types/generators/LootGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/15HttpListenerExample/types/generators/PMCLootGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/15HttpListenerExample/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/15HttpListenerExample/types/generators/PlayerScavGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/15HttpListenerExample/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/15HttpListenerExample/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/15HttpListenerExample/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/15HttpListenerExample/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/15HttpListenerExample/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/15HttpListenerExample/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/15HttpListenerExample/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/15HttpListenerExample/types/helpers/BotHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/BotHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/15HttpListenerExample/types/helpers/ContainerHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/15HttpListenerExample/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/HandbookHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/15HttpListenerExample/types/helpers/PresetHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/PresetHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/15HttpListenerExample/types/helpers/ProfileHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/15HttpListenerExample/types/helpers/RagfairHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/15HttpListenerExample/types/helpers/RagfairSellHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/15HttpListenerExample/types/helpers/RagfairServerHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/15HttpListenerExample/types/helpers/TraderAssortHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/15HttpListenerExample/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/15HttpListenerExample/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/15HttpListenerExample/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/15HttpListenerExample/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/15HttpListenerExample/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/15HttpListenerExample/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/bots/IBots.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/15HttpListenerExample/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/15HttpListenerExample/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/15HttpListenerExample/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/15HttpListenerExample/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/hideout/IHideout.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/15HttpListenerExample/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/templates/ITemplates.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/15HttpListenerExample/types/routers/EventOutputHolder.d.ts b/TypeScript/15HttpListenerExample/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/15HttpListenerExample/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/15HttpListenerExample/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/15HttpListenerExample/types/servers/SaveServer.d.ts b/TypeScript/15HttpListenerExample/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/15HttpListenerExample/types/servers/SaveServer.d.ts +++ b/TypeScript/15HttpListenerExample/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/15HttpListenerExample/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/15HttpListenerExample/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/15HttpListenerExample/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/15HttpListenerExample/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/15HttpListenerExample/types/services/BotEquipmentFilterService.d.ts b/TypeScript/15HttpListenerExample/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/15HttpListenerExample/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/15HttpListenerExample/types/services/BotLootCacheService.d.ts b/TypeScript/15HttpListenerExample/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/15HttpListenerExample/types/services/BotLootCacheService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/15HttpListenerExample/types/services/DatabaseService.d.ts b/TypeScript/15HttpListenerExample/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts b/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/15HttpListenerExample/types/services/GiftService.d.ts b/TypeScript/15HttpListenerExample/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/15HttpListenerExample/types/services/GiftService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/15HttpListenerExample/types/services/InsuranceService.d.ts b/TypeScript/15HttpListenerExample/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/15HttpListenerExample/types/services/InsuranceService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/15HttpListenerExample/types/services/ItemBaseClassService.d.ts b/TypeScript/15HttpListenerExample/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/15HttpListenerExample/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts b/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/15HttpListenerExample/types/services/PaymentService.d.ts b/TypeScript/15HttpListenerExample/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/15HttpListenerExample/types/services/PaymentService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/15HttpListenerExample/types/services/PmcChatResponseService.d.ts b/TypeScript/15HttpListenerExample/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/15HttpListenerExample/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts b/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/15HttpListenerExample/types/services/ProfileSnapshotService.d.ts b/TypeScript/15HttpListenerExample/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/15HttpListenerExample/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/15HttpListenerExample/types/services/RagfairOfferService.d.ts b/TypeScript/15HttpListenerExample/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/15HttpListenerExample/types/services/RagfairOfferService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/15HttpListenerExample/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/15HttpListenerExample/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/15HttpListenerExample/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/15HttpListenerExample/types/services/SeasonalEventService.d.ts b/TypeScript/15HttpListenerExample/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/15HttpListenerExample/types/services/SeasonalEventService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/15HttpListenerExample/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/15HttpListenerExample/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/15HttpListenerExample/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/15HttpListenerExample/types/services/mod/CustomItemService.d.ts b/TypeScript/15HttpListenerExample/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/15HttpListenerExample/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/15HttpListenerExample/types/utils/HttpResponseUtil.d.ts b/TypeScript/15HttpListenerExample/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/15HttpListenerExample/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/15HttpListenerExample/types/utils/JsonUtil.d.ts b/TypeScript/15HttpListenerExample/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/15HttpListenerExample/types/utils/JsonUtil.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/15HttpListenerExample/types/utils/MathUtil.d.ts b/TypeScript/15HttpListenerExample/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/15HttpListenerExample/types/utils/MathUtil.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/15HttpListenerExample/types/utils/RagfairOfferHolder.d.ts b/TypeScript/15HttpListenerExample/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/15HttpListenerExample/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/15HttpListenerExample/types/utils/RandomUtil.d.ts b/TypeScript/15HttpListenerExample/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/15HttpListenerExample/types/utils/RandomUtil.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/15HttpListenerExample/types/utils/TimeUtil.d.ts b/TypeScript/15HttpListenerExample/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/15HttpListenerExample/types/utils/TimeUtil.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/15HttpListenerExample/types/utils/VFS.d.ts b/TypeScript/15HttpListenerExample/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/15HttpListenerExample/types/utils/VFS.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/15HttpListenerExample/types/utils/Watermark.d.ts b/TypeScript/15HttpListenerExample/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/15HttpListenerExample/types/utils/Watermark.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/15HttpListenerExample/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/15HttpListenerExample/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/15HttpListenerExample/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/15HttpListenerExample/types/utils/collections/queue/Queue.d.ts b/TypeScript/15HttpListenerExample/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/15HttpListenerExample/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/16ImporterUtil/types/callbacks/DataCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/16ImporterUtil/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/16ImporterUtil/types/callbacks/MatchCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/16ImporterUtil/types/context/ApplicationContext.d.ts b/TypeScript/16ImporterUtil/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/16ImporterUtil/types/context/ApplicationContext.d.ts +++ b/TypeScript/16ImporterUtil/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/16ImporterUtil/types/controllers/AchievementController.d.ts b/TypeScript/16ImporterUtil/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/16ImporterUtil/types/controllers/AchievementController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts b/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/16ImporterUtil/types/controllers/BuildController.d.ts b/TypeScript/16ImporterUtil/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/16ImporterUtil/types/controllers/BuildController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/16ImporterUtil/types/controllers/CustomizationController.d.ts b/TypeScript/16ImporterUtil/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/16ImporterUtil/types/controllers/CustomizationController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/16ImporterUtil/types/controllers/DialogueController.d.ts b/TypeScript/16ImporterUtil/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/16ImporterUtil/types/controllers/DialogueController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts b/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts b/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/16ImporterUtil/types/controllers/InraidController.d.ts b/TypeScript/16ImporterUtil/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/16ImporterUtil/types/controllers/InraidController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts b/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/16ImporterUtil/types/controllers/InventoryController.d.ts b/TypeScript/16ImporterUtil/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/16ImporterUtil/types/controllers/InventoryController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts b/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/16ImporterUtil/types/controllers/LocationController.d.ts b/TypeScript/16ImporterUtil/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/16ImporterUtil/types/controllers/LocationController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/16ImporterUtil/types/controllers/PresetController.d.ts b/TypeScript/16ImporterUtil/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/16ImporterUtil/types/controllers/PresetController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/16ImporterUtil/types/controllers/ProfileController.d.ts b/TypeScript/16ImporterUtil/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/16ImporterUtil/types/controllers/ProfileController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/16ImporterUtil/types/controllers/QuestController.d.ts b/TypeScript/16ImporterUtil/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/16ImporterUtil/types/controllers/QuestController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/16ImporterUtil/types/controllers/RagfairController.d.ts b/TypeScript/16ImporterUtil/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/16ImporterUtil/types/controllers/RagfairController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/16ImporterUtil/types/controllers/RepairController.d.ts b/TypeScript/16ImporterUtil/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/16ImporterUtil/types/controllers/RepairController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts b/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/16ImporterUtil/types/controllers/TradeController.d.ts b/TypeScript/16ImporterUtil/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/16ImporterUtil/types/controllers/TradeController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/16ImporterUtil/types/controllers/TraderController.d.ts b/TypeScript/16ImporterUtil/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/16ImporterUtil/types/controllers/TraderController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/16ImporterUtil/types/di/Container.d.ts b/TypeScript/16ImporterUtil/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/16ImporterUtil/types/di/Container.d.ts +++ b/TypeScript/16ImporterUtil/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/16ImporterUtil/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/16ImporterUtil/types/generators/BotInventoryGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/16ImporterUtil/types/generators/BotLevelGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/16ImporterUtil/types/generators/BotWeaponGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/16ImporterUtil/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/16ImporterUtil/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/16ImporterUtil/types/generators/LocationGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/16ImporterUtil/types/generators/LocationGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/16ImporterUtil/types/generators/LootGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/16ImporterUtil/types/generators/LootGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/16ImporterUtil/types/generators/PMCLootGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/16ImporterUtil/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/16ImporterUtil/types/generators/PlayerScavGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/16ImporterUtil/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/16ImporterUtil/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/16ImporterUtil/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/16ImporterUtil/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/16ImporterUtil/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/16ImporterUtil/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/16ImporterUtil/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/16ImporterUtil/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/16ImporterUtil/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/16ImporterUtil/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/16ImporterUtil/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/16ImporterUtil/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/16ImporterUtil/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/16ImporterUtil/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/16ImporterUtil/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/16ImporterUtil/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/16ImporterUtil/types/helpers/BotHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/16ImporterUtil/types/helpers/BotHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/16ImporterUtil/types/helpers/ContainerHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/16ImporterUtil/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/16ImporterUtil/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/16ImporterUtil/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/16ImporterUtil/types/helpers/HandbookHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/16ImporterUtil/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/16ImporterUtil/types/helpers/PresetHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/16ImporterUtil/types/helpers/PresetHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/16ImporterUtil/types/helpers/ProfileHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/16ImporterUtil/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/16ImporterUtil/types/helpers/RagfairHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/16ImporterUtil/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/16ImporterUtil/types/helpers/RagfairSellHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/16ImporterUtil/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/16ImporterUtil/types/helpers/RagfairServerHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/16ImporterUtil/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/16ImporterUtil/types/helpers/TraderAssortHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/16ImporterUtil/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/16ImporterUtil/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/16ImporterUtil/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/16ImporterUtil/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/16ImporterUtil/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/16ImporterUtil/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/16ImporterUtil/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/16ImporterUtil/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/16ImporterUtil/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/16ImporterUtil/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/16ImporterUtil/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/16ImporterUtil/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/16ImporterUtil/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/16ImporterUtil/types/models/spt/bots/IBots.d.ts b/TypeScript/16ImporterUtil/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/16ImporterUtil/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/16ImporterUtil/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/16ImporterUtil/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/16ImporterUtil/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/16ImporterUtil/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/16ImporterUtil/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/16ImporterUtil/types/models/spt/hideout/IHideout.d.ts b/TypeScript/16ImporterUtil/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/16ImporterUtil/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/16ImporterUtil/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/16ImporterUtil/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/16ImporterUtil/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/16ImporterUtil/types/models/spt/templates/ITemplates.d.ts b/TypeScript/16ImporterUtil/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/16ImporterUtil/types/routers/EventOutputHolder.d.ts b/TypeScript/16ImporterUtil/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/16ImporterUtil/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/16ImporterUtil/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/16ImporterUtil/types/servers/SaveServer.d.ts b/TypeScript/16ImporterUtil/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/16ImporterUtil/types/servers/SaveServer.d.ts +++ b/TypeScript/16ImporterUtil/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/16ImporterUtil/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/16ImporterUtil/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/16ImporterUtil/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/16ImporterUtil/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/16ImporterUtil/types/services/BotEquipmentFilterService.d.ts b/TypeScript/16ImporterUtil/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/16ImporterUtil/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/16ImporterUtil/types/services/BotLootCacheService.d.ts b/TypeScript/16ImporterUtil/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/16ImporterUtil/types/services/BotLootCacheService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/16ImporterUtil/types/services/DatabaseService.d.ts b/TypeScript/16ImporterUtil/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/16ImporterUtil/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/16ImporterUtil/types/services/FenceService.d.ts b/TypeScript/16ImporterUtil/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/16ImporterUtil/types/services/FenceService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/16ImporterUtil/types/services/GiftService.d.ts b/TypeScript/16ImporterUtil/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/16ImporterUtil/types/services/GiftService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/16ImporterUtil/types/services/InsuranceService.d.ts b/TypeScript/16ImporterUtil/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/16ImporterUtil/types/services/InsuranceService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/16ImporterUtil/types/services/ItemBaseClassService.d.ts b/TypeScript/16ImporterUtil/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/16ImporterUtil/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts b/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/16ImporterUtil/types/services/PaymentService.d.ts b/TypeScript/16ImporterUtil/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/16ImporterUtil/types/services/PaymentService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/16ImporterUtil/types/services/PmcChatResponseService.d.ts b/TypeScript/16ImporterUtil/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/16ImporterUtil/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts b/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/16ImporterUtil/types/services/ProfileSnapshotService.d.ts b/TypeScript/16ImporterUtil/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/16ImporterUtil/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/16ImporterUtil/types/services/RagfairOfferService.d.ts b/TypeScript/16ImporterUtil/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/16ImporterUtil/types/services/RagfairOfferService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/16ImporterUtil/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/16ImporterUtil/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/16ImporterUtil/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/16ImporterUtil/types/services/SeasonalEventService.d.ts b/TypeScript/16ImporterUtil/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/16ImporterUtil/types/services/SeasonalEventService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/16ImporterUtil/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/16ImporterUtil/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/16ImporterUtil/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/16ImporterUtil/types/services/mod/CustomItemService.d.ts b/TypeScript/16ImporterUtil/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/16ImporterUtil/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/16ImporterUtil/types/utils/HttpResponseUtil.d.ts b/TypeScript/16ImporterUtil/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/16ImporterUtil/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/16ImporterUtil/types/utils/JsonUtil.d.ts b/TypeScript/16ImporterUtil/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/16ImporterUtil/types/utils/JsonUtil.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/16ImporterUtil/types/utils/MathUtil.d.ts b/TypeScript/16ImporterUtil/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/16ImporterUtil/types/utils/MathUtil.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/16ImporterUtil/types/utils/RagfairOfferHolder.d.ts b/TypeScript/16ImporterUtil/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/16ImporterUtil/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/16ImporterUtil/types/utils/RandomUtil.d.ts b/TypeScript/16ImporterUtil/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/16ImporterUtil/types/utils/RandomUtil.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/16ImporterUtil/types/utils/TimeUtil.d.ts b/TypeScript/16ImporterUtil/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/16ImporterUtil/types/utils/TimeUtil.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/16ImporterUtil/types/utils/VFS.d.ts b/TypeScript/16ImporterUtil/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/16ImporterUtil/types/utils/VFS.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/16ImporterUtil/types/utils/Watermark.d.ts b/TypeScript/16ImporterUtil/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/16ImporterUtil/types/utils/Watermark.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/16ImporterUtil/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/16ImporterUtil/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/16ImporterUtil/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/16ImporterUtil/types/utils/collections/queue/Queue.d.ts b/TypeScript/16ImporterUtil/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/16ImporterUtil/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DataCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/MatchCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/context/ApplicationContext.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/context/ApplicationContext.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/AchievementController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/AchievementController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BuildController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BuildController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/CustomizationController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/CustomizationController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/DialogueController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/DialogueController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InraidController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InraidController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InventoryController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InventoryController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/LocationController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/LocationController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/PresetController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/PresetController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/ProfileController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/ProfileController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/QuestController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/QuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RagfairController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RagfairController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepairController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepairController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/TradeController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/TradeController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/TraderController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/TraderController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/17AsyncImporterWithDependency1/types/di/Container.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/di/Container.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotInventoryGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLevelGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotWeaponGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/LocationGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/LocationGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/LootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/LootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/PMCLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/PlayerScavGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ContainerHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HandbookHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/PresetHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/PresetHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ProfileHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairSellHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairServerHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderAssortHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IBots.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/17AsyncImporterWithDependency1/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/hideout/IHideout.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/templates/ITemplates.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/routers/EventOutputHolder.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/17AsyncImporterWithDependency1/types/servers/SaveServer.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/servers/SaveServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/17AsyncImporterWithDependency1/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/BotEquipmentFilterService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/BotLootCacheService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/BotLootCacheService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/DatabaseService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/GiftService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/GiftService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/InsuranceService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/InsuranceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/ItemBaseClassService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/PaymentService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/PaymentService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/PmcChatResponseService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileSnapshotService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairOfferService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairOfferService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/SeasonalEventService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/SeasonalEventService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/mod/CustomItemService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/HttpResponseUtil.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/JsonUtil.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/JsonUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/MathUtil.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/MathUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/RagfairOfferHolder.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/RandomUtil.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/RandomUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/TimeUtil.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/TimeUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/VFS.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/VFS.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/Watermark.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/Watermark.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/collections/queue/Queue.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DataCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/MatchCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/context/ApplicationContext.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/context/ApplicationContext.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/AchievementController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/AchievementController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BuildController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BuildController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/CustomizationController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/CustomizationController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/DialogueController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/DialogueController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InraidController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InraidController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InventoryController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InventoryController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/LocationController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/LocationController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/PresetController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/PresetController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/ProfileController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/ProfileController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/QuestController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/QuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RagfairController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RagfairController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepairController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepairController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/TradeController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/TradeController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/TraderController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/TraderController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/17AsyncImporterWithDependency2/types/di/Container.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/di/Container.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotInventoryGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLevelGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotWeaponGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/LocationGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/LocationGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/LootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/LootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/PMCLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/PlayerScavGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ContainerHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HandbookHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/PresetHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/PresetHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ProfileHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairSellHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairServerHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderAssortHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IBots.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/17AsyncImporterWithDependency2/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/hideout/IHideout.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/templates/ITemplates.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/routers/EventOutputHolder.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/17AsyncImporterWithDependency2/types/servers/SaveServer.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/servers/SaveServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/17AsyncImporterWithDependency2/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/BotEquipmentFilterService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/BotLootCacheService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/BotLootCacheService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/DatabaseService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/GiftService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/GiftService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/InsuranceService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/InsuranceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/ItemBaseClassService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/PaymentService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/PaymentService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/PmcChatResponseService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileSnapshotService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairOfferService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairOfferService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/SeasonalEventService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/SeasonalEventService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/mod/CustomItemService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/HttpResponseUtil.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/JsonUtil.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/JsonUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/MathUtil.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/MathUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/RagfairOfferHolder.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/RandomUtil.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/RandomUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/TimeUtil.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/TimeUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/VFS.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/VFS.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/Watermark.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/Watermark.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/collections/queue/Queue.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/18CustomItemService/types/callbacks/DataCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/18CustomItemService/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/18CustomItemService/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/18CustomItemService/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/18CustomItemService/types/callbacks/MatchCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/18CustomItemService/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/18CustomItemService/types/context/ApplicationContext.d.ts b/TypeScript/18CustomItemService/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/18CustomItemService/types/context/ApplicationContext.d.ts +++ b/TypeScript/18CustomItemService/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/18CustomItemService/types/controllers/AchievementController.d.ts b/TypeScript/18CustomItemService/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/18CustomItemService/types/controllers/AchievementController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/18CustomItemService/types/controllers/BotController.d.ts b/TypeScript/18CustomItemService/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/18CustomItemService/types/controllers/BotController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/18CustomItemService/types/controllers/BuildController.d.ts b/TypeScript/18CustomItemService/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/18CustomItemService/types/controllers/BuildController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/18CustomItemService/types/controllers/CustomizationController.d.ts b/TypeScript/18CustomItemService/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/18CustomItemService/types/controllers/CustomizationController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/18CustomItemService/types/controllers/DialogueController.d.ts b/TypeScript/18CustomItemService/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/18CustomItemService/types/controllers/DialogueController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/18CustomItemService/types/controllers/GameController.d.ts b/TypeScript/18CustomItemService/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/18CustomItemService/types/controllers/GameController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts b/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/18CustomItemService/types/controllers/InraidController.d.ts b/TypeScript/18CustomItemService/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/18CustomItemService/types/controllers/InraidController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts b/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/18CustomItemService/types/controllers/InventoryController.d.ts b/TypeScript/18CustomItemService/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/18CustomItemService/types/controllers/InventoryController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts b/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/18CustomItemService/types/controllers/LocationController.d.ts b/TypeScript/18CustomItemService/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/18CustomItemService/types/controllers/LocationController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/18CustomItemService/types/controllers/PresetController.d.ts b/TypeScript/18CustomItemService/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/18CustomItemService/types/controllers/PresetController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/18CustomItemService/types/controllers/ProfileController.d.ts b/TypeScript/18CustomItemService/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/18CustomItemService/types/controllers/ProfileController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/18CustomItemService/types/controllers/QuestController.d.ts b/TypeScript/18CustomItemService/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/18CustomItemService/types/controllers/QuestController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/18CustomItemService/types/controllers/RagfairController.d.ts b/TypeScript/18CustomItemService/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/18CustomItemService/types/controllers/RagfairController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/18CustomItemService/types/controllers/RepairController.d.ts b/TypeScript/18CustomItemService/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/18CustomItemService/types/controllers/RepairController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts b/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/18CustomItemService/types/controllers/TradeController.d.ts b/TypeScript/18CustomItemService/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/18CustomItemService/types/controllers/TradeController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/18CustomItemService/types/controllers/TraderController.d.ts b/TypeScript/18CustomItemService/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/18CustomItemService/types/controllers/TraderController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/18CustomItemService/types/di/Container.d.ts b/TypeScript/18CustomItemService/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/18CustomItemService/types/di/Container.d.ts +++ b/TypeScript/18CustomItemService/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/18CustomItemService/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/18CustomItemService/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/18CustomItemService/types/generators/BotInventoryGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/18CustomItemService/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/18CustomItemService/types/generators/BotLevelGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/18CustomItemService/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/18CustomItemService/types/generators/BotWeaponGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/18CustomItemService/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/18CustomItemService/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/18CustomItemService/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/18CustomItemService/types/generators/LocationGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/18CustomItemService/types/generators/LocationGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/18CustomItemService/types/generators/LootGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/18CustomItemService/types/generators/LootGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/18CustomItemService/types/generators/PMCLootGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/18CustomItemService/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/18CustomItemService/types/generators/PlayerScavGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/18CustomItemService/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/18CustomItemService/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/18CustomItemService/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/18CustomItemService/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/18CustomItemService/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/18CustomItemService/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/18CustomItemService/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/18CustomItemService/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/18CustomItemService/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/18CustomItemService/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/18CustomItemService/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/18CustomItemService/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/18CustomItemService/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/18CustomItemService/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/18CustomItemService/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/18CustomItemService/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/18CustomItemService/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/18CustomItemService/types/helpers/BotHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/18CustomItemService/types/helpers/BotHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/18CustomItemService/types/helpers/ContainerHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/18CustomItemService/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/18CustomItemService/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/18CustomItemService/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/18CustomItemService/types/helpers/HandbookHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/18CustomItemService/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/18CustomItemService/types/helpers/PresetHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/18CustomItemService/types/helpers/PresetHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/18CustomItemService/types/helpers/ProfileHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/18CustomItemService/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/18CustomItemService/types/helpers/RagfairHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/18CustomItemService/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/18CustomItemService/types/helpers/RagfairSellHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/18CustomItemService/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/18CustomItemService/types/helpers/RagfairServerHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/18CustomItemService/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/18CustomItemService/types/helpers/TraderAssortHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/18CustomItemService/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/18CustomItemService/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/18CustomItemService/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/18CustomItemService/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/18CustomItemService/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/18CustomItemService/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/18CustomItemService/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/18CustomItemService/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/18CustomItemService/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/18CustomItemService/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/18CustomItemService/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/18CustomItemService/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/18CustomItemService/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/18CustomItemService/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/18CustomItemService/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/18CustomItemService/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/18CustomItemService/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/18CustomItemService/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/18CustomItemService/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/18CustomItemService/types/models/spt/bots/IBots.d.ts b/TypeScript/18CustomItemService/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/18CustomItemService/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/18CustomItemService/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/18CustomItemService/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/18CustomItemService/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/18CustomItemService/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/18CustomItemService/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/18CustomItemService/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/18CustomItemService/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/18CustomItemService/types/models/spt/hideout/IHideout.d.ts b/TypeScript/18CustomItemService/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/18CustomItemService/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/18CustomItemService/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/18CustomItemService/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/18CustomItemService/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/18CustomItemService/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/18CustomItemService/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/18CustomItemService/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/18CustomItemService/types/models/spt/templates/ITemplates.d.ts b/TypeScript/18CustomItemService/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/18CustomItemService/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/18CustomItemService/types/routers/EventOutputHolder.d.ts b/TypeScript/18CustomItemService/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/18CustomItemService/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/18CustomItemService/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/18CustomItemService/types/servers/SaveServer.d.ts b/TypeScript/18CustomItemService/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/18CustomItemService/types/servers/SaveServer.d.ts +++ b/TypeScript/18CustomItemService/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/18CustomItemService/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/18CustomItemService/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/18CustomItemService/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/18CustomItemService/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/18CustomItemService/types/services/BotEquipmentFilterService.d.ts b/TypeScript/18CustomItemService/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/18CustomItemService/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/18CustomItemService/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/18CustomItemService/types/services/BotLootCacheService.d.ts b/TypeScript/18CustomItemService/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/18CustomItemService/types/services/BotLootCacheService.d.ts +++ b/TypeScript/18CustomItemService/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/18CustomItemService/types/services/DatabaseService.d.ts b/TypeScript/18CustomItemService/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/18CustomItemService/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/18CustomItemService/types/services/FenceService.d.ts b/TypeScript/18CustomItemService/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/18CustomItemService/types/services/FenceService.d.ts +++ b/TypeScript/18CustomItemService/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/18CustomItemService/types/services/GiftService.d.ts b/TypeScript/18CustomItemService/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/18CustomItemService/types/services/GiftService.d.ts +++ b/TypeScript/18CustomItemService/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/18CustomItemService/types/services/InsuranceService.d.ts b/TypeScript/18CustomItemService/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/18CustomItemService/types/services/InsuranceService.d.ts +++ b/TypeScript/18CustomItemService/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/18CustomItemService/types/services/ItemBaseClassService.d.ts b/TypeScript/18CustomItemService/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/18CustomItemService/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/18CustomItemService/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/18CustomItemService/types/services/MailSendService.d.ts b/TypeScript/18CustomItemService/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/18CustomItemService/types/services/MailSendService.d.ts +++ b/TypeScript/18CustomItemService/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/18CustomItemService/types/services/PaymentService.d.ts b/TypeScript/18CustomItemService/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/18CustomItemService/types/services/PaymentService.d.ts +++ b/TypeScript/18CustomItemService/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/18CustomItemService/types/services/PmcChatResponseService.d.ts b/TypeScript/18CustomItemService/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/18CustomItemService/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/18CustomItemService/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts b/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts +++ b/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/18CustomItemService/types/services/ProfileSnapshotService.d.ts b/TypeScript/18CustomItemService/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/18CustomItemService/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/18CustomItemService/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/18CustomItemService/types/services/RagfairOfferService.d.ts b/TypeScript/18CustomItemService/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/18CustomItemService/types/services/RagfairOfferService.d.ts +++ b/TypeScript/18CustomItemService/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/18CustomItemService/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/18CustomItemService/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/18CustomItemService/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/18CustomItemService/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/18CustomItemService/types/services/SeasonalEventService.d.ts b/TypeScript/18CustomItemService/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/18CustomItemService/types/services/SeasonalEventService.d.ts +++ b/TypeScript/18CustomItemService/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/18CustomItemService/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/18CustomItemService/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/18CustomItemService/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/18CustomItemService/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/18CustomItemService/types/services/mod/CustomItemService.d.ts b/TypeScript/18CustomItemService/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/18CustomItemService/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/18CustomItemService/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/18CustomItemService/types/utils/HttpResponseUtil.d.ts b/TypeScript/18CustomItemService/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/18CustomItemService/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/18CustomItemService/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/18CustomItemService/types/utils/JsonUtil.d.ts b/TypeScript/18CustomItemService/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/18CustomItemService/types/utils/JsonUtil.d.ts +++ b/TypeScript/18CustomItemService/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/18CustomItemService/types/utils/MathUtil.d.ts b/TypeScript/18CustomItemService/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/18CustomItemService/types/utils/MathUtil.d.ts +++ b/TypeScript/18CustomItemService/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/18CustomItemService/types/utils/RagfairOfferHolder.d.ts b/TypeScript/18CustomItemService/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/18CustomItemService/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/18CustomItemService/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/18CustomItemService/types/utils/RandomUtil.d.ts b/TypeScript/18CustomItemService/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/18CustomItemService/types/utils/RandomUtil.d.ts +++ b/TypeScript/18CustomItemService/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/18CustomItemService/types/utils/TimeUtil.d.ts b/TypeScript/18CustomItemService/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/18CustomItemService/types/utils/TimeUtil.d.ts +++ b/TypeScript/18CustomItemService/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/18CustomItemService/types/utils/VFS.d.ts b/TypeScript/18CustomItemService/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/18CustomItemService/types/utils/VFS.d.ts +++ b/TypeScript/18CustomItemService/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/18CustomItemService/types/utils/Watermark.d.ts b/TypeScript/18CustomItemService/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/18CustomItemService/types/utils/Watermark.d.ts +++ b/TypeScript/18CustomItemService/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/18CustomItemService/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/18CustomItemService/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/18CustomItemService/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/18CustomItemService/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/18CustomItemService/types/utils/collections/queue/Queue.d.ts b/TypeScript/18CustomItemService/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/18CustomItemService/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/18CustomItemService/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/DataCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/MatchCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/19UseExternalLibraries/types/context/ApplicationContext.d.ts b/TypeScript/19UseExternalLibraries/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/19UseExternalLibraries/types/context/ApplicationContext.d.ts +++ b/TypeScript/19UseExternalLibraries/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/19UseExternalLibraries/types/controllers/AchievementController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/AchievementController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/19UseExternalLibraries/types/controllers/BotController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/BotController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/19UseExternalLibraries/types/controllers/BuildController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/BuildController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/19UseExternalLibraries/types/controllers/CustomizationController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/CustomizationController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/19UseExternalLibraries/types/controllers/DialogueController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/DialogueController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/19UseExternalLibraries/types/controllers/GameController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/GameController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/19UseExternalLibraries/types/controllers/HideoutController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/HideoutController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/19UseExternalLibraries/types/controllers/InraidController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/InraidController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/19UseExternalLibraries/types/controllers/InventoryController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/InventoryController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/19UseExternalLibraries/types/controllers/LauncherController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/LauncherController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/19UseExternalLibraries/types/controllers/LocationController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/LocationController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/19UseExternalLibraries/types/controllers/PresetController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/PresetController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/19UseExternalLibraries/types/controllers/ProfileController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/ProfileController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/19UseExternalLibraries/types/controllers/QuestController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/QuestController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/19UseExternalLibraries/types/controllers/RagfairController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/RagfairController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/19UseExternalLibraries/types/controllers/RepairController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/RepairController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/19UseExternalLibraries/types/controllers/TradeController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/TradeController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/19UseExternalLibraries/types/controllers/TraderController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/TraderController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/19UseExternalLibraries/types/di/Container.d.ts b/TypeScript/19UseExternalLibraries/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/19UseExternalLibraries/types/di/Container.d.ts +++ b/TypeScript/19UseExternalLibraries/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/19UseExternalLibraries/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/19UseExternalLibraries/types/generators/BotGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/BotGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/19UseExternalLibraries/types/generators/BotInventoryGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/19UseExternalLibraries/types/generators/BotLevelGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/19UseExternalLibraries/types/generators/BotLootGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/19UseExternalLibraries/types/generators/BotWeaponGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/19UseExternalLibraries/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/19UseExternalLibraries/types/generators/LocationGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/LocationGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/19UseExternalLibraries/types/generators/LootGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/LootGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/19UseExternalLibraries/types/generators/PMCLootGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/19UseExternalLibraries/types/generators/PlayerScavGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/19UseExternalLibraries/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/19UseExternalLibraries/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/19UseExternalLibraries/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/19UseExternalLibraries/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/19UseExternalLibraries/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/19UseExternalLibraries/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/19UseExternalLibraries/types/helpers/BotHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/BotHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/19UseExternalLibraries/types/helpers/ContainerHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/19UseExternalLibraries/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/19UseExternalLibraries/types/helpers/HandbookHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/19UseExternalLibraries/types/helpers/HideoutHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/19UseExternalLibraries/types/helpers/InRaidHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/19UseExternalLibraries/types/helpers/PresetHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/PresetHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/19UseExternalLibraries/types/helpers/ProfileHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/19UseExternalLibraries/types/helpers/RagfairHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/19UseExternalLibraries/types/helpers/RagfairSellHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/19UseExternalLibraries/types/helpers/RagfairServerHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/19UseExternalLibraries/types/helpers/TraderAssortHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/19UseExternalLibraries/types/helpers/TraderHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/TraderHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotBase.d.ts index 8c747fc..06c1604 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IProfileTemplate.d.ts index 4d73192..1615a25 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/ITemplateItem.d.ts index 32bc9fc..a8ccfbb 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/19UseExternalLibraries/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/19UseExternalLibraries/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/19UseExternalLibraries/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/bots/IBots.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/19UseExternalLibraries/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/19UseExternalLibraries/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/19UseExternalLibraries/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/hideout/IHideout.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/templates/ITemplates.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/19UseExternalLibraries/types/routers/EventOutputHolder.d.ts b/TypeScript/19UseExternalLibraries/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/19UseExternalLibraries/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/19UseExternalLibraries/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/19UseExternalLibraries/types/servers/SaveServer.d.ts b/TypeScript/19UseExternalLibraries/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/19UseExternalLibraries/types/servers/SaveServer.d.ts +++ b/TypeScript/19UseExternalLibraries/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/19UseExternalLibraries/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/19UseExternalLibraries/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/19UseExternalLibraries/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/19UseExternalLibraries/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/19UseExternalLibraries/types/services/BotEquipmentFilterService.d.ts b/TypeScript/19UseExternalLibraries/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/19UseExternalLibraries/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/19UseExternalLibraries/types/services/BotLootCacheService.d.ts b/TypeScript/19UseExternalLibraries/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/19UseExternalLibraries/types/services/BotLootCacheService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/19UseExternalLibraries/types/services/DatabaseService.d.ts b/TypeScript/19UseExternalLibraries/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/19UseExternalLibraries/types/services/FenceService.d.ts b/TypeScript/19UseExternalLibraries/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/19UseExternalLibraries/types/services/FenceService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/19UseExternalLibraries/types/services/GiftService.d.ts b/TypeScript/19UseExternalLibraries/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/19UseExternalLibraries/types/services/GiftService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/19UseExternalLibraries/types/services/InsuranceService.d.ts b/TypeScript/19UseExternalLibraries/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/19UseExternalLibraries/types/services/InsuranceService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/19UseExternalLibraries/types/services/ItemBaseClassService.d.ts b/TypeScript/19UseExternalLibraries/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/19UseExternalLibraries/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/19UseExternalLibraries/types/services/MailSendService.d.ts b/TypeScript/19UseExternalLibraries/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/19UseExternalLibraries/types/services/MailSendService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/19UseExternalLibraries/types/services/PaymentService.d.ts b/TypeScript/19UseExternalLibraries/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/19UseExternalLibraries/types/services/PaymentService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/19UseExternalLibraries/types/services/PmcChatResponseService.d.ts b/TypeScript/19UseExternalLibraries/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/19UseExternalLibraries/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/19UseExternalLibraries/types/services/ProfileFixerService.d.ts b/TypeScript/19UseExternalLibraries/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/19UseExternalLibraries/types/services/ProfileFixerService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/19UseExternalLibraries/types/services/ProfileSnapshotService.d.ts b/TypeScript/19UseExternalLibraries/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/19UseExternalLibraries/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/19UseExternalLibraries/types/services/RagfairOfferService.d.ts b/TypeScript/19UseExternalLibraries/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/19UseExternalLibraries/types/services/RagfairOfferService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/19UseExternalLibraries/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/19UseExternalLibraries/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/19UseExternalLibraries/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/19UseExternalLibraries/types/services/SeasonalEventService.d.ts b/TypeScript/19UseExternalLibraries/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/19UseExternalLibraries/types/services/SeasonalEventService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/19UseExternalLibraries/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/19UseExternalLibraries/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/19UseExternalLibraries/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/19UseExternalLibraries/types/services/mod/CustomItemService.d.ts b/TypeScript/19UseExternalLibraries/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/19UseExternalLibraries/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/19UseExternalLibraries/types/utils/HttpResponseUtil.d.ts b/TypeScript/19UseExternalLibraries/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/19UseExternalLibraries/types/utils/JsonUtil.d.ts b/TypeScript/19UseExternalLibraries/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/JsonUtil.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/19UseExternalLibraries/types/utils/MathUtil.d.ts b/TypeScript/19UseExternalLibraries/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/MathUtil.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/19UseExternalLibraries/types/utils/RagfairOfferHolder.d.ts b/TypeScript/19UseExternalLibraries/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/19UseExternalLibraries/types/utils/RandomUtil.d.ts b/TypeScript/19UseExternalLibraries/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/RandomUtil.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/19UseExternalLibraries/types/utils/TimeUtil.d.ts b/TypeScript/19UseExternalLibraries/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/TimeUtil.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/19UseExternalLibraries/types/utils/VFS.d.ts b/TypeScript/19UseExternalLibraries/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/VFS.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/19UseExternalLibraries/types/utils/Watermark.d.ts b/TypeScript/19UseExternalLibraries/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/Watermark.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/19UseExternalLibraries/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/19UseExternalLibraries/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/19UseExternalLibraries/types/utils/collections/queue/Queue.d.ts b/TypeScript/19UseExternalLibraries/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/1LogToConsole/types/callbacks/DataCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/1LogToConsole/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/1LogToConsole/types/callbacks/MatchCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/1LogToConsole/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/1LogToConsole/types/context/ApplicationContext.d.ts b/TypeScript/1LogToConsole/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/1LogToConsole/types/context/ApplicationContext.d.ts +++ b/TypeScript/1LogToConsole/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/1LogToConsole/types/controllers/AchievementController.d.ts b/TypeScript/1LogToConsole/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/1LogToConsole/types/controllers/AchievementController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/1LogToConsole/types/controllers/BotController.d.ts b/TypeScript/1LogToConsole/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/1LogToConsole/types/controllers/BotController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/1LogToConsole/types/controllers/BuildController.d.ts b/TypeScript/1LogToConsole/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/1LogToConsole/types/controllers/BuildController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/1LogToConsole/types/controllers/CustomizationController.d.ts b/TypeScript/1LogToConsole/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/1LogToConsole/types/controllers/CustomizationController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/1LogToConsole/types/controllers/DialogueController.d.ts b/TypeScript/1LogToConsole/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/1LogToConsole/types/controllers/DialogueController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts b/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts b/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts b/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts b/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts b/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/1LogToConsole/types/controllers/LocationController.d.ts b/TypeScript/1LogToConsole/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/1LogToConsole/types/controllers/LocationController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/1LogToConsole/types/controllers/PresetController.d.ts b/TypeScript/1LogToConsole/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/1LogToConsole/types/controllers/PresetController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts b/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts b/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts b/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/1LogToConsole/types/controllers/RepairController.d.ts b/TypeScript/1LogToConsole/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/1LogToConsole/types/controllers/RepairController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/1LogToConsole/types/controllers/TradeController.d.ts b/TypeScript/1LogToConsole/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/1LogToConsole/types/controllers/TradeController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/1LogToConsole/types/controllers/TraderController.d.ts b/TypeScript/1LogToConsole/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/1LogToConsole/types/controllers/TraderController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/1LogToConsole/types/di/Container.d.ts b/TypeScript/1LogToConsole/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/1LogToConsole/types/di/Container.d.ts +++ b/TypeScript/1LogToConsole/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/1LogToConsole/types/generators/BotInventoryGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/1LogToConsole/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/1LogToConsole/types/generators/BotLevelGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/1LogToConsole/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/1LogToConsole/types/generators/LocationGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/1LogToConsole/types/generators/LocationGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/1LogToConsole/types/generators/LootGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/1LogToConsole/types/generators/LootGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/1LogToConsole/types/generators/PlayerScavGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/1LogToConsole/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/1LogToConsole/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/1LogToConsole/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/1LogToConsole/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/1LogToConsole/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/1LogToConsole/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/1LogToConsole/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/1LogToConsole/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/1LogToConsole/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/1LogToConsole/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/1LogToConsole/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/1LogToConsole/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/1LogToConsole/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/1LogToConsole/types/helpers/BotHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/1LogToConsole/types/helpers/BotHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/1LogToConsole/types/helpers/ContainerHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/1LogToConsole/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/1LogToConsole/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/1LogToConsole/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/1LogToConsole/types/helpers/HandbookHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/1LogToConsole/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/1LogToConsole/types/helpers/RagfairHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/1LogToConsole/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/1LogToConsole/types/helpers/RagfairSellHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/1LogToConsole/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/1LogToConsole/types/helpers/RagfairServerHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/1LogToConsole/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/1LogToConsole/types/helpers/TraderAssortHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/1LogToConsole/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/1LogToConsole/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/1LogToConsole/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/1LogToConsole/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/1LogToConsole/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/1LogToConsole/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/1LogToConsole/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/1LogToConsole/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/1LogToConsole/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/1LogToConsole/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/1LogToConsole/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/1LogToConsole/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/1LogToConsole/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/1LogToConsole/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/1LogToConsole/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/1LogToConsole/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/1LogToConsole/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/1LogToConsole/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/1LogToConsole/types/models/spt/bots/IBots.d.ts b/TypeScript/1LogToConsole/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/1LogToConsole/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/1LogToConsole/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/1LogToConsole/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/1LogToConsole/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/1LogToConsole/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/1LogToConsole/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/1LogToConsole/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/1LogToConsole/types/models/spt/hideout/IHideout.d.ts b/TypeScript/1LogToConsole/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/1LogToConsole/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/1LogToConsole/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/1LogToConsole/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/1LogToConsole/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/1LogToConsole/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/1LogToConsole/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/1LogToConsole/types/models/spt/templates/ITemplates.d.ts b/TypeScript/1LogToConsole/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts b/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/1LogToConsole/types/servers/SaveServer.d.ts b/TypeScript/1LogToConsole/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/1LogToConsole/types/servers/SaveServer.d.ts +++ b/TypeScript/1LogToConsole/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/1LogToConsole/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/1LogToConsole/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/1LogToConsole/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/1LogToConsole/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts b/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/1LogToConsole/types/services/BotLootCacheService.d.ts b/TypeScript/1LogToConsole/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/1LogToConsole/types/services/BotLootCacheService.d.ts +++ b/TypeScript/1LogToConsole/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/1LogToConsole/types/services/DatabaseService.d.ts b/TypeScript/1LogToConsole/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/1LogToConsole/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/1LogToConsole/types/services/FenceService.d.ts b/TypeScript/1LogToConsole/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/1LogToConsole/types/services/FenceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/1LogToConsole/types/services/GiftService.d.ts b/TypeScript/1LogToConsole/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/1LogToConsole/types/services/GiftService.d.ts +++ b/TypeScript/1LogToConsole/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts b/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/1LogToConsole/types/services/ItemBaseClassService.d.ts b/TypeScript/1LogToConsole/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/1LogToConsole/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/1LogToConsole/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/1LogToConsole/types/services/MailSendService.d.ts b/TypeScript/1LogToConsole/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/1LogToConsole/types/services/MailSendService.d.ts +++ b/TypeScript/1LogToConsole/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/1LogToConsole/types/services/PaymentService.d.ts b/TypeScript/1LogToConsole/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/1LogToConsole/types/services/PaymentService.d.ts +++ b/TypeScript/1LogToConsole/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/1LogToConsole/types/services/PmcChatResponseService.d.ts b/TypeScript/1LogToConsole/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/1LogToConsole/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/1LogToConsole/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts b/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts +++ b/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/1LogToConsole/types/services/ProfileSnapshotService.d.ts b/TypeScript/1LogToConsole/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/1LogToConsole/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/1LogToConsole/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/1LogToConsole/types/services/RagfairOfferService.d.ts b/TypeScript/1LogToConsole/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/1LogToConsole/types/services/RagfairOfferService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/1LogToConsole/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/1LogToConsole/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/1LogToConsole/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/1LogToConsole/types/services/SeasonalEventService.d.ts b/TypeScript/1LogToConsole/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/1LogToConsole/types/services/SeasonalEventService.d.ts +++ b/TypeScript/1LogToConsole/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/1LogToConsole/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/1LogToConsole/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/1LogToConsole/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/1LogToConsole/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/1LogToConsole/types/services/mod/CustomItemService.d.ts b/TypeScript/1LogToConsole/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/1LogToConsole/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/1LogToConsole/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/1LogToConsole/types/utils/HttpResponseUtil.d.ts b/TypeScript/1LogToConsole/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/1LogToConsole/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/1LogToConsole/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/1LogToConsole/types/utils/JsonUtil.d.ts b/TypeScript/1LogToConsole/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/1LogToConsole/types/utils/JsonUtil.d.ts +++ b/TypeScript/1LogToConsole/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/1LogToConsole/types/utils/MathUtil.d.ts b/TypeScript/1LogToConsole/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/1LogToConsole/types/utils/MathUtil.d.ts +++ b/TypeScript/1LogToConsole/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/1LogToConsole/types/utils/RagfairOfferHolder.d.ts b/TypeScript/1LogToConsole/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/1LogToConsole/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/1LogToConsole/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/1LogToConsole/types/utils/RandomUtil.d.ts b/TypeScript/1LogToConsole/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/1LogToConsole/types/utils/RandomUtil.d.ts +++ b/TypeScript/1LogToConsole/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/1LogToConsole/types/utils/TimeUtil.d.ts b/TypeScript/1LogToConsole/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/1LogToConsole/types/utils/TimeUtil.d.ts +++ b/TypeScript/1LogToConsole/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/1LogToConsole/types/utils/VFS.d.ts b/TypeScript/1LogToConsole/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/1LogToConsole/types/utils/VFS.d.ts +++ b/TypeScript/1LogToConsole/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/1LogToConsole/types/utils/Watermark.d.ts b/TypeScript/1LogToConsole/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/1LogToConsole/types/utils/Watermark.d.ts +++ b/TypeScript/1LogToConsole/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/1LogToConsole/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/1LogToConsole/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/1LogToConsole/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/1LogToConsole/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/1LogToConsole/types/utils/collections/queue/Queue.d.ts b/TypeScript/1LogToConsole/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/1LogToConsole/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/1LogToConsole/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/20CustomChatBot/types/callbacks/DataCallbacks.d.ts b/TypeScript/20CustomChatBot/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/20CustomChatBot/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/20CustomChatBot/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/20CustomChatBot/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/20CustomChatBot/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/20CustomChatBot/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/20CustomChatBot/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/20CustomChatBot/types/callbacks/MatchCallbacks.d.ts b/TypeScript/20CustomChatBot/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/20CustomChatBot/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/20CustomChatBot/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/20CustomChatBot/types/context/ApplicationContext.d.ts b/TypeScript/20CustomChatBot/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/20CustomChatBot/types/context/ApplicationContext.d.ts +++ b/TypeScript/20CustomChatBot/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/20CustomChatBot/types/controllers/AchievementController.d.ts b/TypeScript/20CustomChatBot/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/20CustomChatBot/types/controllers/AchievementController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/20CustomChatBot/types/controllers/BotController.d.ts b/TypeScript/20CustomChatBot/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/20CustomChatBot/types/controllers/BotController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/20CustomChatBot/types/controllers/BuildController.d.ts b/TypeScript/20CustomChatBot/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/20CustomChatBot/types/controllers/BuildController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/20CustomChatBot/types/controllers/CustomizationController.d.ts b/TypeScript/20CustomChatBot/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/20CustomChatBot/types/controllers/CustomizationController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/20CustomChatBot/types/controllers/DialogueController.d.ts b/TypeScript/20CustomChatBot/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/20CustomChatBot/types/controllers/DialogueController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/20CustomChatBot/types/controllers/GameController.d.ts b/TypeScript/20CustomChatBot/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/20CustomChatBot/types/controllers/GameController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/20CustomChatBot/types/controllers/HideoutController.d.ts b/TypeScript/20CustomChatBot/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/20CustomChatBot/types/controllers/HideoutController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/20CustomChatBot/types/controllers/InraidController.d.ts b/TypeScript/20CustomChatBot/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/20CustomChatBot/types/controllers/InraidController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/20CustomChatBot/types/controllers/InsuranceController.d.ts b/TypeScript/20CustomChatBot/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/20CustomChatBot/types/controllers/InsuranceController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/20CustomChatBot/types/controllers/InventoryController.d.ts b/TypeScript/20CustomChatBot/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/20CustomChatBot/types/controllers/InventoryController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/20CustomChatBot/types/controllers/LauncherController.d.ts b/TypeScript/20CustomChatBot/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/20CustomChatBot/types/controllers/LauncherController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/20CustomChatBot/types/controllers/LocationController.d.ts b/TypeScript/20CustomChatBot/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/20CustomChatBot/types/controllers/LocationController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/20CustomChatBot/types/controllers/PresetController.d.ts b/TypeScript/20CustomChatBot/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/20CustomChatBot/types/controllers/PresetController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/20CustomChatBot/types/controllers/ProfileController.d.ts b/TypeScript/20CustomChatBot/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/20CustomChatBot/types/controllers/ProfileController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/20CustomChatBot/types/controllers/QuestController.d.ts b/TypeScript/20CustomChatBot/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/20CustomChatBot/types/controllers/QuestController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/20CustomChatBot/types/controllers/RagfairController.d.ts b/TypeScript/20CustomChatBot/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/20CustomChatBot/types/controllers/RagfairController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/20CustomChatBot/types/controllers/RepairController.d.ts b/TypeScript/20CustomChatBot/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/20CustomChatBot/types/controllers/RepairController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/20CustomChatBot/types/controllers/RepeatableQuestController.d.ts b/TypeScript/20CustomChatBot/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/20CustomChatBot/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/20CustomChatBot/types/controllers/TradeController.d.ts b/TypeScript/20CustomChatBot/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/20CustomChatBot/types/controllers/TradeController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/20CustomChatBot/types/controllers/TraderController.d.ts b/TypeScript/20CustomChatBot/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/20CustomChatBot/types/controllers/TraderController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/20CustomChatBot/types/di/Container.d.ts b/TypeScript/20CustomChatBot/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/20CustomChatBot/types/di/Container.d.ts +++ b/TypeScript/20CustomChatBot/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/20CustomChatBot/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/20CustomChatBot/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/20CustomChatBot/types/generators/BotGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/20CustomChatBot/types/generators/BotGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/20CustomChatBot/types/generators/BotInventoryGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/20CustomChatBot/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/20CustomChatBot/types/generators/BotLevelGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/20CustomChatBot/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/20CustomChatBot/types/generators/BotLootGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/20CustomChatBot/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/20CustomChatBot/types/generators/BotWeaponGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/20CustomChatBot/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/20CustomChatBot/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/20CustomChatBot/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/20CustomChatBot/types/generators/LocationGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/20CustomChatBot/types/generators/LocationGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/20CustomChatBot/types/generators/LootGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/20CustomChatBot/types/generators/LootGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/20CustomChatBot/types/generators/PMCLootGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/20CustomChatBot/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/20CustomChatBot/types/generators/PlayerScavGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/20CustomChatBot/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/20CustomChatBot/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/20CustomChatBot/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/20CustomChatBot/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/20CustomChatBot/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/20CustomChatBot/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/20CustomChatBot/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/20CustomChatBot/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/20CustomChatBot/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/20CustomChatBot/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/20CustomChatBot/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/20CustomChatBot/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/20CustomChatBot/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/20CustomChatBot/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/20CustomChatBot/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/20CustomChatBot/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/20CustomChatBot/types/helpers/BotHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/20CustomChatBot/types/helpers/BotHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/20CustomChatBot/types/helpers/ContainerHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/20CustomChatBot/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/20CustomChatBot/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/20CustomChatBot/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/20CustomChatBot/types/helpers/HandbookHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/20CustomChatBot/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/20CustomChatBot/types/helpers/HideoutHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/20CustomChatBot/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/20CustomChatBot/types/helpers/InRaidHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/20CustomChatBot/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/20CustomChatBot/types/helpers/ItemHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/20CustomChatBot/types/helpers/ItemHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/20CustomChatBot/types/helpers/PresetHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/20CustomChatBot/types/helpers/PresetHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/20CustomChatBot/types/helpers/ProfileHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/20CustomChatBot/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/20CustomChatBot/types/helpers/RagfairHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/20CustomChatBot/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/20CustomChatBot/types/helpers/RagfairSellHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/20CustomChatBot/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/20CustomChatBot/types/helpers/RagfairServerHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/20CustomChatBot/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/20CustomChatBot/types/helpers/TraderAssortHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/20CustomChatBot/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/20CustomChatBot/types/helpers/TraderHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/20CustomChatBot/types/helpers/TraderHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. diff --git a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotBase.d.ts index 8c747fc..06c1604 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; diff --git a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IProfileTemplate.d.ts index 4d73192..1615a25 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } diff --git a/TypeScript/20CustomChatBot/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/20CustomChatBot/types/models/eft/common/tables/ITemplateItem.d.ts index 32bc9fc..a8ccfbb 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/20CustomChatBot/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/20CustomChatBot/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/20CustomChatBot/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/20CustomChatBot/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/20CustomChatBot/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/20CustomChatBot/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/20CustomChatBot/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/20CustomChatBot/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/20CustomChatBot/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/20CustomChatBot/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/20CustomChatBot/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/20CustomChatBot/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/20CustomChatBot/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/20CustomChatBot/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/20CustomChatBot/types/models/spt/bots/IBots.d.ts b/TypeScript/20CustomChatBot/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/20CustomChatBot/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/20CustomChatBot/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/20CustomChatBot/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/20CustomChatBot/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/20CustomChatBot/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/20CustomChatBot/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/20CustomChatBot/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/20CustomChatBot/types/models/spt/hideout/IHideout.d.ts b/TypeScript/20CustomChatBot/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/20CustomChatBot/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/20CustomChatBot/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/20CustomChatBot/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/20CustomChatBot/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/20CustomChatBot/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/20CustomChatBot/types/models/spt/templates/ITemplates.d.ts b/TypeScript/20CustomChatBot/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/20CustomChatBot/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/20CustomChatBot/types/routers/EventOutputHolder.d.ts b/TypeScript/20CustomChatBot/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/20CustomChatBot/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/20CustomChatBot/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/20CustomChatBot/types/servers/SaveServer.d.ts b/TypeScript/20CustomChatBot/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/20CustomChatBot/types/servers/SaveServer.d.ts +++ b/TypeScript/20CustomChatBot/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/20CustomChatBot/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/20CustomChatBot/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/20CustomChatBot/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/20CustomChatBot/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/20CustomChatBot/types/services/BotEquipmentFilterService.d.ts b/TypeScript/20CustomChatBot/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/20CustomChatBot/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/20CustomChatBot/types/services/BotLootCacheService.d.ts b/TypeScript/20CustomChatBot/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/20CustomChatBot/types/services/BotLootCacheService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/20CustomChatBot/types/services/DatabaseService.d.ts b/TypeScript/20CustomChatBot/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/20CustomChatBot/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/20CustomChatBot/types/services/FenceService.d.ts b/TypeScript/20CustomChatBot/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/20CustomChatBot/types/services/FenceService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/20CustomChatBot/types/services/GiftService.d.ts b/TypeScript/20CustomChatBot/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/20CustomChatBot/types/services/GiftService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/20CustomChatBot/types/services/InsuranceService.d.ts b/TypeScript/20CustomChatBot/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/20CustomChatBot/types/services/InsuranceService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/20CustomChatBot/types/services/ItemBaseClassService.d.ts b/TypeScript/20CustomChatBot/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/20CustomChatBot/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/20CustomChatBot/types/services/MailSendService.d.ts b/TypeScript/20CustomChatBot/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/20CustomChatBot/types/services/MailSendService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/20CustomChatBot/types/services/PaymentService.d.ts b/TypeScript/20CustomChatBot/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/20CustomChatBot/types/services/PaymentService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/20CustomChatBot/types/services/PmcChatResponseService.d.ts b/TypeScript/20CustomChatBot/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/20CustomChatBot/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/20CustomChatBot/types/services/ProfileFixerService.d.ts b/TypeScript/20CustomChatBot/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/20CustomChatBot/types/services/ProfileFixerService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/20CustomChatBot/types/services/ProfileSnapshotService.d.ts b/TypeScript/20CustomChatBot/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/20CustomChatBot/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/20CustomChatBot/types/services/RagfairOfferService.d.ts b/TypeScript/20CustomChatBot/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/20CustomChatBot/types/services/RagfairOfferService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/20CustomChatBot/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/20CustomChatBot/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/20CustomChatBot/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/20CustomChatBot/types/services/SeasonalEventService.d.ts b/TypeScript/20CustomChatBot/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/20CustomChatBot/types/services/SeasonalEventService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/20CustomChatBot/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/20CustomChatBot/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/20CustomChatBot/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/20CustomChatBot/types/services/mod/CustomItemService.d.ts b/TypeScript/20CustomChatBot/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/20CustomChatBot/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/20CustomChatBot/types/utils/HttpResponseUtil.d.ts b/TypeScript/20CustomChatBot/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/20CustomChatBot/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/20CustomChatBot/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/20CustomChatBot/types/utils/JsonUtil.d.ts b/TypeScript/20CustomChatBot/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/20CustomChatBot/types/utils/JsonUtil.d.ts +++ b/TypeScript/20CustomChatBot/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/20CustomChatBot/types/utils/MathUtil.d.ts b/TypeScript/20CustomChatBot/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/20CustomChatBot/types/utils/MathUtil.d.ts +++ b/TypeScript/20CustomChatBot/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/20CustomChatBot/types/utils/RagfairOfferHolder.d.ts b/TypeScript/20CustomChatBot/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/20CustomChatBot/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/20CustomChatBot/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/20CustomChatBot/types/utils/RandomUtil.d.ts b/TypeScript/20CustomChatBot/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/20CustomChatBot/types/utils/RandomUtil.d.ts +++ b/TypeScript/20CustomChatBot/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/20CustomChatBot/types/utils/TimeUtil.d.ts b/TypeScript/20CustomChatBot/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/20CustomChatBot/types/utils/TimeUtil.d.ts +++ b/TypeScript/20CustomChatBot/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/20CustomChatBot/types/utils/VFS.d.ts b/TypeScript/20CustomChatBot/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/20CustomChatBot/types/utils/VFS.d.ts +++ b/TypeScript/20CustomChatBot/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/20CustomChatBot/types/utils/Watermark.d.ts b/TypeScript/20CustomChatBot/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/20CustomChatBot/types/utils/Watermark.d.ts +++ b/TypeScript/20CustomChatBot/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/20CustomChatBot/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/20CustomChatBot/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/20CustomChatBot/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/20CustomChatBot/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/20CustomChatBot/types/utils/collections/queue/Queue.d.ts b/TypeScript/20CustomChatBot/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/20CustomChatBot/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/20CustomChatBot/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/21CustomCommandoCommand/types/callbacks/DataCallbacks.d.ts b/TypeScript/21CustomCommandoCommand/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/21CustomCommandoCommand/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/21CustomCommandoCommand/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/21CustomCommandoCommand/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/21CustomCommandoCommand/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/21CustomCommandoCommand/types/callbacks/MatchCallbacks.d.ts b/TypeScript/21CustomCommandoCommand/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/21CustomCommandoCommand/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/21CustomCommandoCommand/types/context/ApplicationContext.d.ts b/TypeScript/21CustomCommandoCommand/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/21CustomCommandoCommand/types/context/ApplicationContext.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/AchievementController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/AchievementController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/BotController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/BotController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/BuildController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/BuildController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/CustomizationController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/CustomizationController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/DialogueController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/DialogueController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/GameController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/GameController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/HideoutController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/HideoutController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/InraidController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/InraidController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/InsuranceController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/InsuranceController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/InventoryController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/InventoryController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/LauncherController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/LauncherController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/LocationController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/LocationController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/PresetController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/PresetController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/ProfileController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/ProfileController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/QuestController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/QuestController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/RagfairController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/RagfairController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/RepairController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/RepairController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/RepeatableQuestController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/TradeController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/TradeController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/TraderController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/TraderController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/21CustomCommandoCommand/types/di/Container.d.ts b/TypeScript/21CustomCommandoCommand/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/21CustomCommandoCommand/types/di/Container.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/21CustomCommandoCommand/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/21CustomCommandoCommand/types/generators/BotGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/BotGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/21CustomCommandoCommand/types/generators/BotInventoryGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/21CustomCommandoCommand/types/generators/BotLevelGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/21CustomCommandoCommand/types/generators/BotLootGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/21CustomCommandoCommand/types/generators/BotWeaponGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/21CustomCommandoCommand/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/21CustomCommandoCommand/types/generators/LocationGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/LocationGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/21CustomCommandoCommand/types/generators/LootGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/LootGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/21CustomCommandoCommand/types/generators/PMCLootGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/21CustomCommandoCommand/types/generators/PlayerScavGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/21CustomCommandoCommand/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/21CustomCommandoCommand/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/21CustomCommandoCommand/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/BotHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/BotHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/ContainerHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/HandbookHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/HideoutHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/InRaidHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/ItemHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/ItemHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/PresetHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/PresetHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/ProfileHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/RagfairHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/RagfairSellHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/RagfairServerHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/TraderAssortHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/TraderHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/TraderHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotBase.d.ts index 8c747fc..06c1604 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IProfileTemplate.d.ts index 4d73192..1615a25 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/ITemplateItem.d.ts index 32bc9fc..a8ccfbb 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/21CustomCommandoCommand/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/21CustomCommandoCommand/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/bots/IBots.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/21CustomCommandoCommand/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/21CustomCommandoCommand/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/21CustomCommandoCommand/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/hideout/IHideout.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/templates/ITemplates.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/21CustomCommandoCommand/types/routers/EventOutputHolder.d.ts b/TypeScript/21CustomCommandoCommand/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/21CustomCommandoCommand/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/21CustomCommandoCommand/types/servers/SaveServer.d.ts b/TypeScript/21CustomCommandoCommand/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/21CustomCommandoCommand/types/servers/SaveServer.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/21CustomCommandoCommand/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/21CustomCommandoCommand/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/21CustomCommandoCommand/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/21CustomCommandoCommand/types/services/BotEquipmentFilterService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/21CustomCommandoCommand/types/services/BotLootCacheService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/BotLootCacheService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/21CustomCommandoCommand/types/services/DatabaseService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/21CustomCommandoCommand/types/services/FenceService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/FenceService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/21CustomCommandoCommand/types/services/GiftService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/GiftService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/21CustomCommandoCommand/types/services/InsuranceService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/InsuranceService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/21CustomCommandoCommand/types/services/ItemBaseClassService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/21CustomCommandoCommand/types/services/MailSendService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/MailSendService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/21CustomCommandoCommand/types/services/PaymentService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/PaymentService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/21CustomCommandoCommand/types/services/PmcChatResponseService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/21CustomCommandoCommand/types/services/ProfileFixerService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/ProfileFixerService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/21CustomCommandoCommand/types/services/ProfileSnapshotService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/21CustomCommandoCommand/types/services/RagfairOfferService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/RagfairOfferService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/21CustomCommandoCommand/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/21CustomCommandoCommand/types/services/SeasonalEventService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/SeasonalEventService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/21CustomCommandoCommand/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/21CustomCommandoCommand/types/services/mod/CustomItemService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/21CustomCommandoCommand/types/utils/HttpResponseUtil.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/21CustomCommandoCommand/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/21CustomCommandoCommand/types/utils/JsonUtil.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/21CustomCommandoCommand/types/utils/JsonUtil.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/21CustomCommandoCommand/types/utils/MathUtil.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/21CustomCommandoCommand/types/utils/MathUtil.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/21CustomCommandoCommand/types/utils/RagfairOfferHolder.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/21CustomCommandoCommand/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/21CustomCommandoCommand/types/utils/RandomUtil.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/21CustomCommandoCommand/types/utils/RandomUtil.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/21CustomCommandoCommand/types/utils/TimeUtil.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/21CustomCommandoCommand/types/utils/TimeUtil.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/21CustomCommandoCommand/types/utils/VFS.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/21CustomCommandoCommand/types/utils/VFS.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/21CustomCommandoCommand/types/utils/Watermark.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/21CustomCommandoCommand/types/utils/Watermark.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/21CustomCommandoCommand/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/21CustomCommandoCommand/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/21CustomCommandoCommand/types/utils/collections/queue/Queue.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/21CustomCommandoCommand/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/22CustomAkiCommand/types/callbacks/DataCallbacks.d.ts b/TypeScript/22CustomAkiCommand/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/22CustomAkiCommand/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/22CustomAkiCommand/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/22CustomAkiCommand/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/22CustomAkiCommand/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/22CustomAkiCommand/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/22CustomAkiCommand/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/22CustomAkiCommand/types/callbacks/MatchCallbacks.d.ts b/TypeScript/22CustomAkiCommand/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/22CustomAkiCommand/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/22CustomAkiCommand/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/22CustomAkiCommand/types/context/ApplicationContext.d.ts b/TypeScript/22CustomAkiCommand/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/22CustomAkiCommand/types/context/ApplicationContext.d.ts +++ b/TypeScript/22CustomAkiCommand/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/22CustomAkiCommand/types/controllers/AchievementController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/AchievementController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/22CustomAkiCommand/types/controllers/BotController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/BotController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/22CustomAkiCommand/types/controllers/BuildController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/BuildController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/22CustomAkiCommand/types/controllers/CustomizationController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/CustomizationController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/22CustomAkiCommand/types/controllers/DialogueController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/DialogueController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/22CustomAkiCommand/types/controllers/GameController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/GameController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/22CustomAkiCommand/types/controllers/HideoutController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/HideoutController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/22CustomAkiCommand/types/controllers/InraidController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/InraidController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/22CustomAkiCommand/types/controllers/InsuranceController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/InsuranceController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/22CustomAkiCommand/types/controllers/InventoryController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/InventoryController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/22CustomAkiCommand/types/controllers/LauncherController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/LauncherController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/22CustomAkiCommand/types/controllers/LocationController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/LocationController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/22CustomAkiCommand/types/controllers/PresetController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/PresetController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/22CustomAkiCommand/types/controllers/ProfileController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/ProfileController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/22CustomAkiCommand/types/controllers/QuestController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/QuestController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/22CustomAkiCommand/types/controllers/RagfairController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/RagfairController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/22CustomAkiCommand/types/controllers/RepairController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/RepairController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/22CustomAkiCommand/types/controllers/RepeatableQuestController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/22CustomAkiCommand/types/controllers/TradeController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/TradeController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/22CustomAkiCommand/types/controllers/TraderController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/TraderController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/22CustomAkiCommand/types/di/Container.d.ts b/TypeScript/22CustomAkiCommand/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/22CustomAkiCommand/types/di/Container.d.ts +++ b/TypeScript/22CustomAkiCommand/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/22CustomAkiCommand/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/22CustomAkiCommand/types/generators/BotGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/BotGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/22CustomAkiCommand/types/generators/BotInventoryGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/22CustomAkiCommand/types/generators/BotLevelGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/22CustomAkiCommand/types/generators/BotLootGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/22CustomAkiCommand/types/generators/BotWeaponGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/22CustomAkiCommand/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/22CustomAkiCommand/types/generators/LocationGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/LocationGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/22CustomAkiCommand/types/generators/LootGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/LootGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/22CustomAkiCommand/types/generators/PMCLootGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/22CustomAkiCommand/types/generators/PlayerScavGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/22CustomAkiCommand/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/22CustomAkiCommand/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/22CustomAkiCommand/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/22CustomAkiCommand/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/22CustomAkiCommand/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/22CustomAkiCommand/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/22CustomAkiCommand/types/helpers/BotHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/BotHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/22CustomAkiCommand/types/helpers/ContainerHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/22CustomAkiCommand/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/22CustomAkiCommand/types/helpers/HandbookHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/22CustomAkiCommand/types/helpers/HideoutHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/22CustomAkiCommand/types/helpers/InRaidHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/22CustomAkiCommand/types/helpers/ItemHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/ItemHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/22CustomAkiCommand/types/helpers/PresetHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/PresetHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/22CustomAkiCommand/types/helpers/ProfileHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/22CustomAkiCommand/types/helpers/RagfairHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/22CustomAkiCommand/types/helpers/RagfairSellHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/22CustomAkiCommand/types/helpers/RagfairServerHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/22CustomAkiCommand/types/helpers/TraderAssortHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/22CustomAkiCommand/types/helpers/TraderHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/TraderHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotBase.d.ts index 8c747fc..06c1604 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IProfileTemplate.d.ts index 4d73192..1615a25 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/ITemplateItem.d.ts index 32bc9fc..a8ccfbb 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/22CustomAkiCommand/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/22CustomAkiCommand/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/22CustomAkiCommand/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/bots/IBots.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/22CustomAkiCommand/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/22CustomAkiCommand/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/22CustomAkiCommand/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/hideout/IHideout.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/templates/ITemplates.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/22CustomAkiCommand/types/routers/EventOutputHolder.d.ts b/TypeScript/22CustomAkiCommand/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/22CustomAkiCommand/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/22CustomAkiCommand/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/22CustomAkiCommand/types/servers/SaveServer.d.ts b/TypeScript/22CustomAkiCommand/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/22CustomAkiCommand/types/servers/SaveServer.d.ts +++ b/TypeScript/22CustomAkiCommand/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/22CustomAkiCommand/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/22CustomAkiCommand/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/22CustomAkiCommand/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/22CustomAkiCommand/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/22CustomAkiCommand/types/services/BotEquipmentFilterService.d.ts b/TypeScript/22CustomAkiCommand/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/22CustomAkiCommand/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/22CustomAkiCommand/types/services/BotLootCacheService.d.ts b/TypeScript/22CustomAkiCommand/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/22CustomAkiCommand/types/services/BotLootCacheService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/22CustomAkiCommand/types/services/DatabaseService.d.ts b/TypeScript/22CustomAkiCommand/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/22CustomAkiCommand/types/services/FenceService.d.ts b/TypeScript/22CustomAkiCommand/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/22CustomAkiCommand/types/services/FenceService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/22CustomAkiCommand/types/services/GiftService.d.ts b/TypeScript/22CustomAkiCommand/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/22CustomAkiCommand/types/services/GiftService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/22CustomAkiCommand/types/services/InsuranceService.d.ts b/TypeScript/22CustomAkiCommand/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/22CustomAkiCommand/types/services/InsuranceService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/22CustomAkiCommand/types/services/ItemBaseClassService.d.ts b/TypeScript/22CustomAkiCommand/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/22CustomAkiCommand/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/22CustomAkiCommand/types/services/MailSendService.d.ts b/TypeScript/22CustomAkiCommand/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/22CustomAkiCommand/types/services/MailSendService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/22CustomAkiCommand/types/services/PaymentService.d.ts b/TypeScript/22CustomAkiCommand/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/22CustomAkiCommand/types/services/PaymentService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/22CustomAkiCommand/types/services/PmcChatResponseService.d.ts b/TypeScript/22CustomAkiCommand/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/22CustomAkiCommand/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/22CustomAkiCommand/types/services/ProfileFixerService.d.ts b/TypeScript/22CustomAkiCommand/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/22CustomAkiCommand/types/services/ProfileFixerService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/22CustomAkiCommand/types/services/ProfileSnapshotService.d.ts b/TypeScript/22CustomAkiCommand/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/22CustomAkiCommand/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/22CustomAkiCommand/types/services/RagfairOfferService.d.ts b/TypeScript/22CustomAkiCommand/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/22CustomAkiCommand/types/services/RagfairOfferService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/22CustomAkiCommand/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/22CustomAkiCommand/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/22CustomAkiCommand/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/22CustomAkiCommand/types/services/SeasonalEventService.d.ts b/TypeScript/22CustomAkiCommand/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/22CustomAkiCommand/types/services/SeasonalEventService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/22CustomAkiCommand/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/22CustomAkiCommand/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/22CustomAkiCommand/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/22CustomAkiCommand/types/services/mod/CustomItemService.d.ts b/TypeScript/22CustomAkiCommand/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/22CustomAkiCommand/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/22CustomAkiCommand/types/utils/HttpResponseUtil.d.ts b/TypeScript/22CustomAkiCommand/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/22CustomAkiCommand/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/22CustomAkiCommand/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/22CustomAkiCommand/types/utils/JsonUtil.d.ts b/TypeScript/22CustomAkiCommand/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/22CustomAkiCommand/types/utils/JsonUtil.d.ts +++ b/TypeScript/22CustomAkiCommand/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/22CustomAkiCommand/types/utils/MathUtil.d.ts b/TypeScript/22CustomAkiCommand/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/22CustomAkiCommand/types/utils/MathUtil.d.ts +++ b/TypeScript/22CustomAkiCommand/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/22CustomAkiCommand/types/utils/RagfairOfferHolder.d.ts b/TypeScript/22CustomAkiCommand/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/22CustomAkiCommand/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/22CustomAkiCommand/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/22CustomAkiCommand/types/utils/RandomUtil.d.ts b/TypeScript/22CustomAkiCommand/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/22CustomAkiCommand/types/utils/RandomUtil.d.ts +++ b/TypeScript/22CustomAkiCommand/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/22CustomAkiCommand/types/utils/TimeUtil.d.ts b/TypeScript/22CustomAkiCommand/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/22CustomAkiCommand/types/utils/TimeUtil.d.ts +++ b/TypeScript/22CustomAkiCommand/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/22CustomAkiCommand/types/utils/VFS.d.ts b/TypeScript/22CustomAkiCommand/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/22CustomAkiCommand/types/utils/VFS.d.ts +++ b/TypeScript/22CustomAkiCommand/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/22CustomAkiCommand/types/utils/Watermark.d.ts b/TypeScript/22CustomAkiCommand/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/22CustomAkiCommand/types/utils/Watermark.d.ts +++ b/TypeScript/22CustomAkiCommand/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/22CustomAkiCommand/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/22CustomAkiCommand/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/22CustomAkiCommand/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/22CustomAkiCommand/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/22CustomAkiCommand/types/utils/collections/queue/Queue.d.ts b/TypeScript/22CustomAkiCommand/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/22CustomAkiCommand/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/22CustomAkiCommand/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/2EditDatabase/types/callbacks/DataCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/2EditDatabase/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/2EditDatabase/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/2EditDatabase/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/2EditDatabase/types/callbacks/MatchCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/2EditDatabase/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/2EditDatabase/types/context/ApplicationContext.d.ts b/TypeScript/2EditDatabase/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/2EditDatabase/types/context/ApplicationContext.d.ts +++ b/TypeScript/2EditDatabase/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/2EditDatabase/types/controllers/AchievementController.d.ts b/TypeScript/2EditDatabase/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/2EditDatabase/types/controllers/AchievementController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/2EditDatabase/types/controllers/BotController.d.ts b/TypeScript/2EditDatabase/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/2EditDatabase/types/controllers/BotController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/2EditDatabase/types/controllers/BuildController.d.ts b/TypeScript/2EditDatabase/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/2EditDatabase/types/controllers/BuildController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/2EditDatabase/types/controllers/CustomizationController.d.ts b/TypeScript/2EditDatabase/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/2EditDatabase/types/controllers/CustomizationController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/2EditDatabase/types/controllers/DialogueController.d.ts b/TypeScript/2EditDatabase/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/2EditDatabase/types/controllers/DialogueController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/2EditDatabase/types/controllers/GameController.d.ts b/TypeScript/2EditDatabase/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/2EditDatabase/types/controllers/GameController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts b/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/2EditDatabase/types/controllers/InraidController.d.ts b/TypeScript/2EditDatabase/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/2EditDatabase/types/controllers/InraidController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts b/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts b/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts b/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/2EditDatabase/types/controllers/LocationController.d.ts b/TypeScript/2EditDatabase/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/2EditDatabase/types/controllers/LocationController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/2EditDatabase/types/controllers/PresetController.d.ts b/TypeScript/2EditDatabase/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/2EditDatabase/types/controllers/PresetController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/2EditDatabase/types/controllers/ProfileController.d.ts b/TypeScript/2EditDatabase/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/2EditDatabase/types/controllers/ProfileController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts b/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts b/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/2EditDatabase/types/controllers/RepairController.d.ts b/TypeScript/2EditDatabase/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/2EditDatabase/types/controllers/RepairController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts b/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/2EditDatabase/types/controllers/TradeController.d.ts b/TypeScript/2EditDatabase/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/2EditDatabase/types/controllers/TradeController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/2EditDatabase/types/controllers/TraderController.d.ts b/TypeScript/2EditDatabase/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/2EditDatabase/types/controllers/TraderController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/2EditDatabase/types/di/Container.d.ts b/TypeScript/2EditDatabase/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/2EditDatabase/types/di/Container.d.ts +++ b/TypeScript/2EditDatabase/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/2EditDatabase/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/2EditDatabase/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/2EditDatabase/types/generators/BotInventoryGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/2EditDatabase/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/2EditDatabase/types/generators/BotLevelGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/2EditDatabase/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/2EditDatabase/types/generators/BotWeaponGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/2EditDatabase/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/2EditDatabase/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/2EditDatabase/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/2EditDatabase/types/generators/LocationGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/2EditDatabase/types/generators/LocationGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/2EditDatabase/types/generators/LootGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/2EditDatabase/types/generators/LootGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/2EditDatabase/types/generators/PMCLootGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/2EditDatabase/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/2EditDatabase/types/generators/PlayerScavGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/2EditDatabase/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/2EditDatabase/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/2EditDatabase/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/2EditDatabase/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/2EditDatabase/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/2EditDatabase/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/2EditDatabase/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/2EditDatabase/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/2EditDatabase/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/2EditDatabase/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/2EditDatabase/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/2EditDatabase/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/2EditDatabase/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/2EditDatabase/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/2EditDatabase/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/2EditDatabase/types/helpers/BotHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/2EditDatabase/types/helpers/BotHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/2EditDatabase/types/helpers/ContainerHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/2EditDatabase/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/2EditDatabase/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/2EditDatabase/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/2EditDatabase/types/helpers/HandbookHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/2EditDatabase/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/2EditDatabase/types/helpers/RagfairHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/2EditDatabase/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/2EditDatabase/types/helpers/RagfairSellHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/2EditDatabase/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/2EditDatabase/types/helpers/RagfairServerHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/2EditDatabase/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/2EditDatabase/types/helpers/TraderAssortHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/2EditDatabase/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/2EditDatabase/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/2EditDatabase/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/2EditDatabase/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/2EditDatabase/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/2EditDatabase/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/2EditDatabase/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/2EditDatabase/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/2EditDatabase/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/2EditDatabase/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/2EditDatabase/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/2EditDatabase/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/2EditDatabase/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/2EditDatabase/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/2EditDatabase/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/2EditDatabase/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/2EditDatabase/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/2EditDatabase/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/2EditDatabase/types/models/spt/bots/IBots.d.ts b/TypeScript/2EditDatabase/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/2EditDatabase/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/2EditDatabase/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/2EditDatabase/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/2EditDatabase/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/2EditDatabase/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/2EditDatabase/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/2EditDatabase/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/2EditDatabase/types/models/spt/hideout/IHideout.d.ts b/TypeScript/2EditDatabase/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/2EditDatabase/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/2EditDatabase/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/2EditDatabase/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/2EditDatabase/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/2EditDatabase/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/2EditDatabase/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/2EditDatabase/types/models/spt/templates/ITemplates.d.ts b/TypeScript/2EditDatabase/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/2EditDatabase/types/routers/EventOutputHolder.d.ts b/TypeScript/2EditDatabase/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/2EditDatabase/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/2EditDatabase/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/2EditDatabase/types/servers/SaveServer.d.ts b/TypeScript/2EditDatabase/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/2EditDatabase/types/servers/SaveServer.d.ts +++ b/TypeScript/2EditDatabase/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/2EditDatabase/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/2EditDatabase/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/2EditDatabase/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/2EditDatabase/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/2EditDatabase/types/services/BotEquipmentFilterService.d.ts b/TypeScript/2EditDatabase/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/2EditDatabase/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/2EditDatabase/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/2EditDatabase/types/services/BotLootCacheService.d.ts b/TypeScript/2EditDatabase/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/2EditDatabase/types/services/BotLootCacheService.d.ts +++ b/TypeScript/2EditDatabase/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/2EditDatabase/types/services/DatabaseService.d.ts b/TypeScript/2EditDatabase/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/2EditDatabase/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/2EditDatabase/types/services/FenceService.d.ts b/TypeScript/2EditDatabase/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/2EditDatabase/types/services/FenceService.d.ts +++ b/TypeScript/2EditDatabase/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/2EditDatabase/types/services/GiftService.d.ts b/TypeScript/2EditDatabase/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/2EditDatabase/types/services/GiftService.d.ts +++ b/TypeScript/2EditDatabase/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/2EditDatabase/types/services/InsuranceService.d.ts b/TypeScript/2EditDatabase/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/2EditDatabase/types/services/InsuranceService.d.ts +++ b/TypeScript/2EditDatabase/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/2EditDatabase/types/services/ItemBaseClassService.d.ts b/TypeScript/2EditDatabase/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/2EditDatabase/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/2EditDatabase/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/2EditDatabase/types/services/MailSendService.d.ts b/TypeScript/2EditDatabase/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/2EditDatabase/types/services/MailSendService.d.ts +++ b/TypeScript/2EditDatabase/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/2EditDatabase/types/services/PaymentService.d.ts b/TypeScript/2EditDatabase/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/2EditDatabase/types/services/PaymentService.d.ts +++ b/TypeScript/2EditDatabase/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/2EditDatabase/types/services/PmcChatResponseService.d.ts b/TypeScript/2EditDatabase/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/2EditDatabase/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/2EditDatabase/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts b/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts +++ b/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/2EditDatabase/types/services/ProfileSnapshotService.d.ts b/TypeScript/2EditDatabase/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/2EditDatabase/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/2EditDatabase/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/2EditDatabase/types/services/RagfairOfferService.d.ts b/TypeScript/2EditDatabase/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/2EditDatabase/types/services/RagfairOfferService.d.ts +++ b/TypeScript/2EditDatabase/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/2EditDatabase/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/2EditDatabase/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/2EditDatabase/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/2EditDatabase/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/2EditDatabase/types/services/SeasonalEventService.d.ts b/TypeScript/2EditDatabase/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/2EditDatabase/types/services/SeasonalEventService.d.ts +++ b/TypeScript/2EditDatabase/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/2EditDatabase/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/2EditDatabase/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/2EditDatabase/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/2EditDatabase/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/2EditDatabase/types/services/mod/CustomItemService.d.ts b/TypeScript/2EditDatabase/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/2EditDatabase/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/2EditDatabase/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/2EditDatabase/types/utils/HttpResponseUtil.d.ts b/TypeScript/2EditDatabase/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/2EditDatabase/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/2EditDatabase/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/2EditDatabase/types/utils/JsonUtil.d.ts b/TypeScript/2EditDatabase/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/2EditDatabase/types/utils/JsonUtil.d.ts +++ b/TypeScript/2EditDatabase/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/2EditDatabase/types/utils/MathUtil.d.ts b/TypeScript/2EditDatabase/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/2EditDatabase/types/utils/MathUtil.d.ts +++ b/TypeScript/2EditDatabase/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/2EditDatabase/types/utils/RagfairOfferHolder.d.ts b/TypeScript/2EditDatabase/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/2EditDatabase/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/2EditDatabase/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/2EditDatabase/types/utils/RandomUtil.d.ts b/TypeScript/2EditDatabase/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/2EditDatabase/types/utils/RandomUtil.d.ts +++ b/TypeScript/2EditDatabase/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/2EditDatabase/types/utils/TimeUtil.d.ts b/TypeScript/2EditDatabase/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/2EditDatabase/types/utils/TimeUtil.d.ts +++ b/TypeScript/2EditDatabase/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/2EditDatabase/types/utils/VFS.d.ts b/TypeScript/2EditDatabase/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/2EditDatabase/types/utils/VFS.d.ts +++ b/TypeScript/2EditDatabase/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/2EditDatabase/types/utils/Watermark.d.ts b/TypeScript/2EditDatabase/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/2EditDatabase/types/utils/Watermark.d.ts +++ b/TypeScript/2EditDatabase/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/2EditDatabase/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/2EditDatabase/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/2EditDatabase/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/2EditDatabase/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/2EditDatabase/types/utils/collections/queue/Queue.d.ts b/TypeScript/2EditDatabase/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/2EditDatabase/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/2EditDatabase/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/DataCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/MatchCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/3GetSptConfigFile/types/context/ApplicationContext.d.ts b/TypeScript/3GetSptConfigFile/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/3GetSptConfigFile/types/context/ApplicationContext.d.ts +++ b/TypeScript/3GetSptConfigFile/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/AchievementController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/AchievementController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/3GetSptConfigFile/types/controllers/BuildController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/BuildController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/3GetSptConfigFile/types/controllers/CustomizationController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/CustomizationController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/3GetSptConfigFile/types/controllers/DialogueController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/DialogueController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InraidController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InraidController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/3GetSptConfigFile/types/controllers/LocationController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/LocationController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/3GetSptConfigFile/types/controllers/PresetController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/PresetController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/ProfileController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/ProfileController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/3GetSptConfigFile/types/controllers/RepairController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/RepairController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/3GetSptConfigFile/types/controllers/TradeController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/TradeController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/3GetSptConfigFile/types/controllers/TraderController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/TraderController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/3GetSptConfigFile/types/di/Container.d.ts b/TypeScript/3GetSptConfigFile/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/3GetSptConfigFile/types/di/Container.d.ts +++ b/TypeScript/3GetSptConfigFile/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotInventoryGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotLevelGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotWeaponGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/3GetSptConfigFile/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/3GetSptConfigFile/types/generators/LocationGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/LocationGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/3GetSptConfigFile/types/generators/LootGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/LootGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/3GetSptConfigFile/types/generators/PMCLootGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/3GetSptConfigFile/types/generators/PlayerScavGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/3GetSptConfigFile/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/3GetSptConfigFile/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/3GetSptConfigFile/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/3GetSptConfigFile/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/3GetSptConfigFile/types/helpers/BotHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/BotHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/3GetSptConfigFile/types/helpers/ContainerHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/HandbookHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/3GetSptConfigFile/types/helpers/RagfairHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/3GetSptConfigFile/types/helpers/RagfairSellHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/3GetSptConfigFile/types/helpers/RagfairServerHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/3GetSptConfigFile/types/helpers/TraderAssortHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/bots/IBots.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/3GetSptConfigFile/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/3GetSptConfigFile/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/3GetSptConfigFile/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/hideout/IHideout.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/templates/ITemplates.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/3GetSptConfigFile/types/routers/EventOutputHolder.d.ts b/TypeScript/3GetSptConfigFile/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/3GetSptConfigFile/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/3GetSptConfigFile/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/3GetSptConfigFile/types/servers/SaveServer.d.ts b/TypeScript/3GetSptConfigFile/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/3GetSptConfigFile/types/servers/SaveServer.d.ts +++ b/TypeScript/3GetSptConfigFile/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/3GetSptConfigFile/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/3GetSptConfigFile/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/3GetSptConfigFile/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/3GetSptConfigFile/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/3GetSptConfigFile/types/services/BotEquipmentFilterService.d.ts b/TypeScript/3GetSptConfigFile/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/3GetSptConfigFile/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/3GetSptConfigFile/types/services/BotLootCacheService.d.ts b/TypeScript/3GetSptConfigFile/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/3GetSptConfigFile/types/services/BotLootCacheService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/3GetSptConfigFile/types/services/DatabaseService.d.ts b/TypeScript/3GetSptConfigFile/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts b/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/3GetSptConfigFile/types/services/GiftService.d.ts b/TypeScript/3GetSptConfigFile/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/3GetSptConfigFile/types/services/GiftService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/3GetSptConfigFile/types/services/InsuranceService.d.ts b/TypeScript/3GetSptConfigFile/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/3GetSptConfigFile/types/services/InsuranceService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/3GetSptConfigFile/types/services/ItemBaseClassService.d.ts b/TypeScript/3GetSptConfigFile/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/3GetSptConfigFile/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts b/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/3GetSptConfigFile/types/services/PaymentService.d.ts b/TypeScript/3GetSptConfigFile/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/3GetSptConfigFile/types/services/PaymentService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/services/PmcChatResponseService.d.ts b/TypeScript/3GetSptConfigFile/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/3GetSptConfigFile/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts b/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/3GetSptConfigFile/types/services/ProfileSnapshotService.d.ts b/TypeScript/3GetSptConfigFile/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/3GetSptConfigFile/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/3GetSptConfigFile/types/services/RagfairOfferService.d.ts b/TypeScript/3GetSptConfigFile/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/3GetSptConfigFile/types/services/RagfairOfferService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/3GetSptConfigFile/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/3GetSptConfigFile/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/3GetSptConfigFile/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/3GetSptConfigFile/types/services/SeasonalEventService.d.ts b/TypeScript/3GetSptConfigFile/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/3GetSptConfigFile/types/services/SeasonalEventService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/3GetSptConfigFile/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/3GetSptConfigFile/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/3GetSptConfigFile/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/3GetSptConfigFile/types/services/mod/CustomItemService.d.ts b/TypeScript/3GetSptConfigFile/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/3GetSptConfigFile/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/3GetSptConfigFile/types/utils/HttpResponseUtil.d.ts b/TypeScript/3GetSptConfigFile/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/3GetSptConfigFile/types/utils/JsonUtil.d.ts b/TypeScript/3GetSptConfigFile/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/JsonUtil.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/3GetSptConfigFile/types/utils/MathUtil.d.ts b/TypeScript/3GetSptConfigFile/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/MathUtil.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/3GetSptConfigFile/types/utils/RagfairOfferHolder.d.ts b/TypeScript/3GetSptConfigFile/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/3GetSptConfigFile/types/utils/RandomUtil.d.ts b/TypeScript/3GetSptConfigFile/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/RandomUtil.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/3GetSptConfigFile/types/utils/TimeUtil.d.ts b/TypeScript/3GetSptConfigFile/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/TimeUtil.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/3GetSptConfigFile/types/utils/VFS.d.ts b/TypeScript/3GetSptConfigFile/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/VFS.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/3GetSptConfigFile/types/utils/Watermark.d.ts b/TypeScript/3GetSptConfigFile/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/Watermark.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/3GetSptConfigFile/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/3GetSptConfigFile/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/3GetSptConfigFile/types/utils/collections/queue/Queue.d.ts b/TypeScript/3GetSptConfigFile/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DataCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/MatchCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/context/ApplicationContext.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/context/ApplicationContext.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/AchievementController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/AchievementController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BuildController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BuildController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/CustomizationController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/CustomizationController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/DialogueController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/DialogueController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HideoutController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HideoutController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InraidController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InraidController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InventoryController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InventoryController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LocationController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LocationController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/PresetController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/PresetController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/ProfileController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/ProfileController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/QuestController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/QuestController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RagfairController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RagfairController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepairController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepairController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/TradeController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/TradeController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/TraderController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/TraderController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/di/Container.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/di/Container.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotInventoryGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLevelGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotWeaponGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LocationGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LocationGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LootGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LootGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/PMCLootGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/PlayerScavGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ContainerHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HandbookHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/InRaidHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/PresetHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/PresetHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ProfileHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairSellHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairServerHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderAssortHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotBase.d.ts index 8c747fc..06c1604 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts index 4d73192..1615a25 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts index 32bc9fc..a8ccfbb 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IBots.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/hideout/IHideout.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/templates/ITemplates.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/routers/EventOutputHolder.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/SaveServer.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/SaveServer.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotEquipmentFilterService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotLootCacheService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotLootCacheService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/DatabaseService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/FenceService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/FenceService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/GiftService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/GiftService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/InsuranceService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/InsuranceService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ItemBaseClassService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/MailSendService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/MailSendService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PaymentService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PaymentService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PmcChatResponseService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileFixerService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileFixerService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileSnapshotService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairOfferService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairOfferService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/SeasonalEventService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/SeasonalEventService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/mod/CustomItemService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/HttpResponseUtil.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/JsonUtil.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/JsonUtil.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/MathUtil.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/MathUtil.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/RagfairOfferHolder.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/RandomUtil.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/RandomUtil.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/TimeUtil.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/TimeUtil.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/VFS.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/VFS.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/Watermark.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/Watermark.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/collections/queue/Queue.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/DataCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/MatchCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/4UseACustomConfigFile/types/context/ApplicationContext.d.ts b/TypeScript/4UseACustomConfigFile/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/4UseACustomConfigFile/types/context/ApplicationContext.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/AchievementController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/AchievementController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/BuildController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/BuildController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/CustomizationController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/CustomizationController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/DialogueController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/DialogueController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InraidController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InraidController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/LocationController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/LocationController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/PresetController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/PresetController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/ProfileController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/ProfileController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/RepairController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/RepairController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/TradeController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/TradeController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/TraderController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/TraderController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/4UseACustomConfigFile/types/di/Container.d.ts b/TypeScript/4UseACustomConfigFile/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/4UseACustomConfigFile/types/di/Container.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotInventoryGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotLevelGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotWeaponGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/4UseACustomConfigFile/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/4UseACustomConfigFile/types/generators/LocationGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/LocationGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/4UseACustomConfigFile/types/generators/LootGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/LootGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/4UseACustomConfigFile/types/generators/PMCLootGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/4UseACustomConfigFile/types/generators/PlayerScavGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/4UseACustomConfigFile/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/4UseACustomConfigFile/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/BotHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/BotHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/ContainerHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/HandbookHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairSellHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairServerHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/TraderAssortHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/bots/IBots.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/4UseACustomConfigFile/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/4UseACustomConfigFile/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/4UseACustomConfigFile/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/hideout/IHideout.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/templates/ITemplates.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/4UseACustomConfigFile/types/routers/EventOutputHolder.d.ts b/TypeScript/4UseACustomConfigFile/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/4UseACustomConfigFile/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/4UseACustomConfigFile/types/servers/SaveServer.d.ts b/TypeScript/4UseACustomConfigFile/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/4UseACustomConfigFile/types/servers/SaveServer.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/4UseACustomConfigFile/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/4UseACustomConfigFile/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/4UseACustomConfigFile/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/4UseACustomConfigFile/types/services/BotEquipmentFilterService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/4UseACustomConfigFile/types/services/BotLootCacheService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/BotLootCacheService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/4UseACustomConfigFile/types/services/DatabaseService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/4UseACustomConfigFile/types/services/GiftService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/GiftService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/4UseACustomConfigFile/types/services/InsuranceService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/InsuranceService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/4UseACustomConfigFile/types/services/ItemBaseClassService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/4UseACustomConfigFile/types/services/PaymentService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/PaymentService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/services/PmcChatResponseService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/4UseACustomConfigFile/types/services/ProfileSnapshotService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/4UseACustomConfigFile/types/services/RagfairOfferService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/RagfairOfferService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/4UseACustomConfigFile/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/4UseACustomConfigFile/types/services/SeasonalEventService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/SeasonalEventService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/4UseACustomConfigFile/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/4UseACustomConfigFile/types/services/mod/CustomItemService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/4UseACustomConfigFile/types/utils/HttpResponseUtil.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/4UseACustomConfigFile/types/utils/JsonUtil.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/JsonUtil.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/4UseACustomConfigFile/types/utils/MathUtil.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/MathUtil.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/4UseACustomConfigFile/types/utils/RagfairOfferHolder.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/4UseACustomConfigFile/types/utils/RandomUtil.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/RandomUtil.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/4UseACustomConfigFile/types/utils/TimeUtil.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/TimeUtil.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/4UseACustomConfigFile/types/utils/VFS.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/VFS.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/4UseACustomConfigFile/types/utils/Watermark.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/Watermark.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/4UseACustomConfigFile/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/4UseACustomConfigFile/types/utils/collections/queue/Queue.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/5ReplaceMethod/types/callbacks/DataCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/5ReplaceMethod/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/5ReplaceMethod/types/callbacks/MatchCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/5ReplaceMethod/types/context/ApplicationContext.d.ts b/TypeScript/5ReplaceMethod/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/5ReplaceMethod/types/context/ApplicationContext.d.ts +++ b/TypeScript/5ReplaceMethod/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/AchievementController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/AchievementController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/5ReplaceMethod/types/controllers/BuildController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/BuildController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/5ReplaceMethod/types/controllers/CustomizationController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/CustomizationController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/5ReplaceMethod/types/controllers/DialogueController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/DialogueController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/5ReplaceMethod/types/controllers/InraidController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InraidController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/5ReplaceMethod/types/controllers/LocationController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/LocationController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/5ReplaceMethod/types/controllers/PresetController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/PresetController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/ProfileController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/ProfileController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/5ReplaceMethod/types/controllers/RepairController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/RepairController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/5ReplaceMethod/types/controllers/TradeController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/TradeController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/5ReplaceMethod/types/controllers/TraderController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/TraderController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/5ReplaceMethod/types/di/Container.d.ts b/TypeScript/5ReplaceMethod/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/5ReplaceMethod/types/di/Container.d.ts +++ b/TypeScript/5ReplaceMethod/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/5ReplaceMethod/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/5ReplaceMethod/types/generators/BotInventoryGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/5ReplaceMethod/types/generators/BotLevelGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/5ReplaceMethod/types/generators/BotWeaponGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/5ReplaceMethod/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/5ReplaceMethod/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/5ReplaceMethod/types/generators/LocationGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/5ReplaceMethod/types/generators/LocationGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/5ReplaceMethod/types/generators/LootGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/5ReplaceMethod/types/generators/LootGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/5ReplaceMethod/types/generators/PMCLootGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/5ReplaceMethod/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/5ReplaceMethod/types/generators/PlayerScavGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/5ReplaceMethod/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/5ReplaceMethod/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/5ReplaceMethod/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/5ReplaceMethod/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/5ReplaceMethod/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/5ReplaceMethod/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/5ReplaceMethod/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/5ReplaceMethod/types/helpers/BotHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/BotHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/5ReplaceMethod/types/helpers/ContainerHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/5ReplaceMethod/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/HandbookHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/5ReplaceMethod/types/helpers/RagfairHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/5ReplaceMethod/types/helpers/RagfairSellHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/5ReplaceMethod/types/helpers/RagfairServerHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/5ReplaceMethod/types/helpers/TraderAssortHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/5ReplaceMethod/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/5ReplaceMethod/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/bots/IBots.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/5ReplaceMethod/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/5ReplaceMethod/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/5ReplaceMethod/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/5ReplaceMethod/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/hideout/IHideout.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/5ReplaceMethod/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/templates/ITemplates.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/5ReplaceMethod/types/routers/EventOutputHolder.d.ts b/TypeScript/5ReplaceMethod/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/5ReplaceMethod/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/5ReplaceMethod/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/5ReplaceMethod/types/servers/SaveServer.d.ts b/TypeScript/5ReplaceMethod/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/5ReplaceMethod/types/servers/SaveServer.d.ts +++ b/TypeScript/5ReplaceMethod/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/5ReplaceMethod/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/5ReplaceMethod/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/5ReplaceMethod/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/5ReplaceMethod/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/5ReplaceMethod/types/services/BotEquipmentFilterService.d.ts b/TypeScript/5ReplaceMethod/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/5ReplaceMethod/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/5ReplaceMethod/types/services/BotLootCacheService.d.ts b/TypeScript/5ReplaceMethod/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/5ReplaceMethod/types/services/BotLootCacheService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/5ReplaceMethod/types/services/DatabaseService.d.ts b/TypeScript/5ReplaceMethod/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts b/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/5ReplaceMethod/types/services/GiftService.d.ts b/TypeScript/5ReplaceMethod/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/5ReplaceMethod/types/services/GiftService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/5ReplaceMethod/types/services/InsuranceService.d.ts b/TypeScript/5ReplaceMethod/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/5ReplaceMethod/types/services/InsuranceService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/5ReplaceMethod/types/services/ItemBaseClassService.d.ts b/TypeScript/5ReplaceMethod/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/5ReplaceMethod/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts b/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/5ReplaceMethod/types/services/PaymentService.d.ts b/TypeScript/5ReplaceMethod/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/5ReplaceMethod/types/services/PaymentService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/5ReplaceMethod/types/services/PmcChatResponseService.d.ts b/TypeScript/5ReplaceMethod/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/5ReplaceMethod/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts b/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/5ReplaceMethod/types/services/ProfileSnapshotService.d.ts b/TypeScript/5ReplaceMethod/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/5ReplaceMethod/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/5ReplaceMethod/types/services/RagfairOfferService.d.ts b/TypeScript/5ReplaceMethod/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/5ReplaceMethod/types/services/RagfairOfferService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/5ReplaceMethod/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/5ReplaceMethod/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/5ReplaceMethod/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/5ReplaceMethod/types/services/SeasonalEventService.d.ts b/TypeScript/5ReplaceMethod/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/5ReplaceMethod/types/services/SeasonalEventService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/5ReplaceMethod/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/5ReplaceMethod/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/5ReplaceMethod/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/5ReplaceMethod/types/services/mod/CustomItemService.d.ts b/TypeScript/5ReplaceMethod/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/5ReplaceMethod/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/5ReplaceMethod/types/utils/HttpResponseUtil.d.ts b/TypeScript/5ReplaceMethod/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/5ReplaceMethod/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/5ReplaceMethod/types/utils/JsonUtil.d.ts b/TypeScript/5ReplaceMethod/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/5ReplaceMethod/types/utils/JsonUtil.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/5ReplaceMethod/types/utils/MathUtil.d.ts b/TypeScript/5ReplaceMethod/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/5ReplaceMethod/types/utils/MathUtil.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/5ReplaceMethod/types/utils/RagfairOfferHolder.d.ts b/TypeScript/5ReplaceMethod/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/5ReplaceMethod/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/5ReplaceMethod/types/utils/RandomUtil.d.ts b/TypeScript/5ReplaceMethod/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/5ReplaceMethod/types/utils/RandomUtil.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/5ReplaceMethod/types/utils/TimeUtil.d.ts b/TypeScript/5ReplaceMethod/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/5ReplaceMethod/types/utils/TimeUtil.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/5ReplaceMethod/types/utils/VFS.d.ts b/TypeScript/5ReplaceMethod/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/5ReplaceMethod/types/utils/VFS.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/5ReplaceMethod/types/utils/Watermark.d.ts b/TypeScript/5ReplaceMethod/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/5ReplaceMethod/types/utils/Watermark.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/5ReplaceMethod/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/5ReplaceMethod/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/5ReplaceMethod/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/5ReplaceMethod/types/utils/collections/queue/Queue.d.ts b/TypeScript/5ReplaceMethod/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/5ReplaceMethod/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/DataCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/MatchCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/6ReferenceAnotherClass/types/context/ApplicationContext.d.ts b/TypeScript/6ReferenceAnotherClass/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/context/ApplicationContext.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/AchievementController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/AchievementController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/BuildController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/BuildController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/CustomizationController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/CustomizationController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/DialogueController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/DialogueController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InraidController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InraidController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/LocationController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/LocationController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/PresetController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/PresetController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/ProfileController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/ProfileController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/RepairController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/RepairController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/TradeController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/TradeController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/TraderController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/TraderController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/6ReferenceAnotherClass/types/di/Container.d.ts b/TypeScript/6ReferenceAnotherClass/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/6ReferenceAnotherClass/types/di/Container.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotInventoryGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotLevelGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotWeaponGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/LocationGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/LocationGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/LootGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/LootGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/PMCLootGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/PlayerScavGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/BotHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/BotHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/ContainerHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/HandbookHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairSellHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairServerHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderAssortHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IBots.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/6ReferenceAnotherClass/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/hideout/IHideout.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/templates/ITemplates.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/routers/EventOutputHolder.d.ts b/TypeScript/6ReferenceAnotherClass/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/6ReferenceAnotherClass/types/servers/SaveServer.d.ts b/TypeScript/6ReferenceAnotherClass/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/6ReferenceAnotherClass/types/servers/SaveServer.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/6ReferenceAnotherClass/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/6ReferenceAnotherClass/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/6ReferenceAnotherClass/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/6ReferenceAnotherClass/types/services/BotEquipmentFilterService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/6ReferenceAnotherClass/types/services/BotLootCacheService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/BotLootCacheService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/6ReferenceAnotherClass/types/services/DatabaseService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/6ReferenceAnotherClass/types/services/GiftService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/GiftService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/6ReferenceAnotherClass/types/services/InsuranceService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/InsuranceService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/6ReferenceAnotherClass/types/services/ItemBaseClassService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/6ReferenceAnotherClass/types/services/PaymentService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/PaymentService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/services/PmcChatResponseService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/6ReferenceAnotherClass/types/services/ProfileSnapshotService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/6ReferenceAnotherClass/types/services/RagfairOfferService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/RagfairOfferService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/6ReferenceAnotherClass/types/services/SeasonalEventService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/SeasonalEventService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/6ReferenceAnotherClass/types/services/mod/CustomItemService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/HttpResponseUtil.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/JsonUtil.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/JsonUtil.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/MathUtil.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/MathUtil.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/RagfairOfferHolder.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/RandomUtil.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/RandomUtil.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/TimeUtil.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/TimeUtil.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/VFS.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/VFS.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/Watermark.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/Watermark.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/collections/queue/Queue.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/7OnLoadHook/types/callbacks/DataCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/7OnLoadHook/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/7OnLoadHook/types/callbacks/MatchCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/7OnLoadHook/types/context/ApplicationContext.d.ts b/TypeScript/7OnLoadHook/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/7OnLoadHook/types/context/ApplicationContext.d.ts +++ b/TypeScript/7OnLoadHook/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/7OnLoadHook/types/controllers/AchievementController.d.ts b/TypeScript/7OnLoadHook/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/7OnLoadHook/types/controllers/AchievementController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts b/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/7OnLoadHook/types/controllers/BuildController.d.ts b/TypeScript/7OnLoadHook/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/7OnLoadHook/types/controllers/BuildController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/7OnLoadHook/types/controllers/CustomizationController.d.ts b/TypeScript/7OnLoadHook/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/7OnLoadHook/types/controllers/CustomizationController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/7OnLoadHook/types/controllers/DialogueController.d.ts b/TypeScript/7OnLoadHook/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/7OnLoadHook/types/controllers/DialogueController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts b/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts b/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/7OnLoadHook/types/controllers/InraidController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InraidController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts b/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/7OnLoadHook/types/controllers/LocationController.d.ts b/TypeScript/7OnLoadHook/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/7OnLoadHook/types/controllers/LocationController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/7OnLoadHook/types/controllers/PresetController.d.ts b/TypeScript/7OnLoadHook/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/7OnLoadHook/types/controllers/PresetController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/7OnLoadHook/types/controllers/ProfileController.d.ts b/TypeScript/7OnLoadHook/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/7OnLoadHook/types/controllers/ProfileController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts b/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts b/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/7OnLoadHook/types/controllers/RepairController.d.ts b/TypeScript/7OnLoadHook/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/7OnLoadHook/types/controllers/RepairController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/7OnLoadHook/types/controllers/TradeController.d.ts b/TypeScript/7OnLoadHook/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/7OnLoadHook/types/controllers/TradeController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/7OnLoadHook/types/controllers/TraderController.d.ts b/TypeScript/7OnLoadHook/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/7OnLoadHook/types/controllers/TraderController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/7OnLoadHook/types/di/Container.d.ts b/TypeScript/7OnLoadHook/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/7OnLoadHook/types/di/Container.d.ts +++ b/TypeScript/7OnLoadHook/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/7OnLoadHook/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/7OnLoadHook/types/generators/BotInventoryGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/7OnLoadHook/types/generators/BotLevelGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/7OnLoadHook/types/generators/BotWeaponGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/7OnLoadHook/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/7OnLoadHook/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/7OnLoadHook/types/generators/LocationGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/7OnLoadHook/types/generators/LocationGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/7OnLoadHook/types/generators/LootGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/7OnLoadHook/types/generators/LootGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/7OnLoadHook/types/generators/PMCLootGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/7OnLoadHook/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/7OnLoadHook/types/generators/PlayerScavGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/7OnLoadHook/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/7OnLoadHook/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/7OnLoadHook/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/7OnLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/7OnLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/7OnLoadHook/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/7OnLoadHook/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/7OnLoadHook/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/7OnLoadHook/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/7OnLoadHook/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/7OnLoadHook/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/7OnLoadHook/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/7OnLoadHook/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/7OnLoadHook/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/7OnLoadHook/types/helpers/BotHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/7OnLoadHook/types/helpers/BotHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/7OnLoadHook/types/helpers/ContainerHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/7OnLoadHook/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/7OnLoadHook/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/7OnLoadHook/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/7OnLoadHook/types/helpers/HandbookHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/7OnLoadHook/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/7OnLoadHook/types/helpers/RagfairHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/7OnLoadHook/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/7OnLoadHook/types/helpers/RagfairSellHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/7OnLoadHook/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/7OnLoadHook/types/helpers/RagfairServerHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/7OnLoadHook/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/7OnLoadHook/types/helpers/TraderAssortHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/7OnLoadHook/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/7OnLoadHook/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/7OnLoadHook/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/7OnLoadHook/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/7OnLoadHook/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/7OnLoadHook/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/7OnLoadHook/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/7OnLoadHook/types/models/spt/bots/IBots.d.ts b/TypeScript/7OnLoadHook/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/7OnLoadHook/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/7OnLoadHook/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/7OnLoadHook/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/7OnLoadHook/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/7OnLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/7OnLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/7OnLoadHook/types/models/spt/hideout/IHideout.d.ts b/TypeScript/7OnLoadHook/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/7OnLoadHook/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/7OnLoadHook/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/7OnLoadHook/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/7OnLoadHook/types/models/spt/templates/ITemplates.d.ts b/TypeScript/7OnLoadHook/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/7OnLoadHook/types/routers/EventOutputHolder.d.ts b/TypeScript/7OnLoadHook/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/7OnLoadHook/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/7OnLoadHook/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/7OnLoadHook/types/servers/SaveServer.d.ts b/TypeScript/7OnLoadHook/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/7OnLoadHook/types/servers/SaveServer.d.ts +++ b/TypeScript/7OnLoadHook/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/7OnLoadHook/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/7OnLoadHook/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/7OnLoadHook/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/7OnLoadHook/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/7OnLoadHook/types/services/BotEquipmentFilterService.d.ts b/TypeScript/7OnLoadHook/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/7OnLoadHook/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/7OnLoadHook/types/services/BotLootCacheService.d.ts b/TypeScript/7OnLoadHook/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/7OnLoadHook/types/services/BotLootCacheService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/7OnLoadHook/types/services/DatabaseService.d.ts b/TypeScript/7OnLoadHook/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/7OnLoadHook/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/7OnLoadHook/types/services/FenceService.d.ts b/TypeScript/7OnLoadHook/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/7OnLoadHook/types/services/FenceService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/7OnLoadHook/types/services/GiftService.d.ts b/TypeScript/7OnLoadHook/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/7OnLoadHook/types/services/GiftService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/7OnLoadHook/types/services/InsuranceService.d.ts b/TypeScript/7OnLoadHook/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/7OnLoadHook/types/services/InsuranceService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/7OnLoadHook/types/services/ItemBaseClassService.d.ts b/TypeScript/7OnLoadHook/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/7OnLoadHook/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts b/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/7OnLoadHook/types/services/PaymentService.d.ts b/TypeScript/7OnLoadHook/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/7OnLoadHook/types/services/PaymentService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/7OnLoadHook/types/services/PmcChatResponseService.d.ts b/TypeScript/7OnLoadHook/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/7OnLoadHook/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts b/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/7OnLoadHook/types/services/ProfileSnapshotService.d.ts b/TypeScript/7OnLoadHook/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/7OnLoadHook/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/7OnLoadHook/types/services/RagfairOfferService.d.ts b/TypeScript/7OnLoadHook/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/7OnLoadHook/types/services/RagfairOfferService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/7OnLoadHook/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/7OnLoadHook/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/7OnLoadHook/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/7OnLoadHook/types/services/SeasonalEventService.d.ts b/TypeScript/7OnLoadHook/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/7OnLoadHook/types/services/SeasonalEventService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/7OnLoadHook/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/7OnLoadHook/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/7OnLoadHook/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/7OnLoadHook/types/services/mod/CustomItemService.d.ts b/TypeScript/7OnLoadHook/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/7OnLoadHook/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/7OnLoadHook/types/utils/HttpResponseUtil.d.ts b/TypeScript/7OnLoadHook/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/7OnLoadHook/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/7OnLoadHook/types/utils/JsonUtil.d.ts b/TypeScript/7OnLoadHook/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/7OnLoadHook/types/utils/JsonUtil.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/7OnLoadHook/types/utils/MathUtil.d.ts b/TypeScript/7OnLoadHook/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/7OnLoadHook/types/utils/MathUtil.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/7OnLoadHook/types/utils/RagfairOfferHolder.d.ts b/TypeScript/7OnLoadHook/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/7OnLoadHook/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/7OnLoadHook/types/utils/RandomUtil.d.ts b/TypeScript/7OnLoadHook/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/7OnLoadHook/types/utils/RandomUtil.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/7OnLoadHook/types/utils/TimeUtil.d.ts b/TypeScript/7OnLoadHook/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/7OnLoadHook/types/utils/TimeUtil.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/7OnLoadHook/types/utils/VFS.d.ts b/TypeScript/7OnLoadHook/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/7OnLoadHook/types/utils/VFS.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/7OnLoadHook/types/utils/Watermark.d.ts b/TypeScript/7OnLoadHook/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/7OnLoadHook/types/utils/Watermark.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/7OnLoadHook/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/7OnLoadHook/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/7OnLoadHook/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/7OnLoadHook/types/utils/collections/queue/Queue.d.ts b/TypeScript/7OnLoadHook/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/7OnLoadHook/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/8OnUpdateHook/types/callbacks/DataCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/8OnUpdateHook/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/8OnUpdateHook/types/callbacks/MatchCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/8OnUpdateHook/types/context/ApplicationContext.d.ts b/TypeScript/8OnUpdateHook/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/8OnUpdateHook/types/context/ApplicationContext.d.ts +++ b/TypeScript/8OnUpdateHook/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/AchievementController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/AchievementController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/8OnUpdateHook/types/controllers/BuildController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/BuildController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/8OnUpdateHook/types/controllers/CustomizationController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/CustomizationController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/8OnUpdateHook/types/controllers/DialogueController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/DialogueController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/8OnUpdateHook/types/controllers/InraidController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InraidController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/8OnUpdateHook/types/controllers/LocationController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/LocationController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/8OnUpdateHook/types/controllers/PresetController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/PresetController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/ProfileController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/ProfileController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/8OnUpdateHook/types/controllers/RepairController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/RepairController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/8OnUpdateHook/types/controllers/TradeController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/TradeController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/8OnUpdateHook/types/controllers/TraderController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/TraderController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/8OnUpdateHook/types/di/Container.d.ts b/TypeScript/8OnUpdateHook/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/8OnUpdateHook/types/di/Container.d.ts +++ b/TypeScript/8OnUpdateHook/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/8OnUpdateHook/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/8OnUpdateHook/types/generators/BotInventoryGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/8OnUpdateHook/types/generators/BotLevelGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/8OnUpdateHook/types/generators/BotWeaponGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/8OnUpdateHook/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/8OnUpdateHook/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/8OnUpdateHook/types/generators/LocationGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/8OnUpdateHook/types/generators/LocationGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/8OnUpdateHook/types/generators/LootGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/8OnUpdateHook/types/generators/LootGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/8OnUpdateHook/types/generators/PMCLootGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/8OnUpdateHook/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/8OnUpdateHook/types/generators/PlayerScavGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/8OnUpdateHook/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/8OnUpdateHook/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/8OnUpdateHook/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/8OnUpdateHook/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/8OnUpdateHook/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/8OnUpdateHook/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/8OnUpdateHook/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/8OnUpdateHook/types/helpers/BotHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/BotHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/8OnUpdateHook/types/helpers/ContainerHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/8OnUpdateHook/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/HandbookHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/8OnUpdateHook/types/helpers/RagfairHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/8OnUpdateHook/types/helpers/RagfairSellHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/8OnUpdateHook/types/helpers/RagfairServerHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/8OnUpdateHook/types/helpers/TraderAssortHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/8OnUpdateHook/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/8OnUpdateHook/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/bots/IBots.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/8OnUpdateHook/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/8OnUpdateHook/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/8OnUpdateHook/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/8OnUpdateHook/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/hideout/IHideout.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/8OnUpdateHook/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/templates/ITemplates.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/8OnUpdateHook/types/routers/EventOutputHolder.d.ts b/TypeScript/8OnUpdateHook/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/8OnUpdateHook/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/8OnUpdateHook/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/8OnUpdateHook/types/servers/SaveServer.d.ts b/TypeScript/8OnUpdateHook/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/8OnUpdateHook/types/servers/SaveServer.d.ts +++ b/TypeScript/8OnUpdateHook/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/8OnUpdateHook/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/8OnUpdateHook/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/8OnUpdateHook/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/8OnUpdateHook/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/8OnUpdateHook/types/services/BotEquipmentFilterService.d.ts b/TypeScript/8OnUpdateHook/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/8OnUpdateHook/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/8OnUpdateHook/types/services/BotLootCacheService.d.ts b/TypeScript/8OnUpdateHook/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/8OnUpdateHook/types/services/BotLootCacheService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/8OnUpdateHook/types/services/DatabaseService.d.ts b/TypeScript/8OnUpdateHook/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts b/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/8OnUpdateHook/types/services/GiftService.d.ts b/TypeScript/8OnUpdateHook/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/8OnUpdateHook/types/services/GiftService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/8OnUpdateHook/types/services/InsuranceService.d.ts b/TypeScript/8OnUpdateHook/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/8OnUpdateHook/types/services/InsuranceService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/8OnUpdateHook/types/services/ItemBaseClassService.d.ts b/TypeScript/8OnUpdateHook/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/8OnUpdateHook/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts b/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/8OnUpdateHook/types/services/PaymentService.d.ts b/TypeScript/8OnUpdateHook/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/8OnUpdateHook/types/services/PaymentService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/8OnUpdateHook/types/services/PmcChatResponseService.d.ts b/TypeScript/8OnUpdateHook/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/8OnUpdateHook/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts b/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/8OnUpdateHook/types/services/ProfileSnapshotService.d.ts b/TypeScript/8OnUpdateHook/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/8OnUpdateHook/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/8OnUpdateHook/types/services/RagfairOfferService.d.ts b/TypeScript/8OnUpdateHook/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/8OnUpdateHook/types/services/RagfairOfferService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/8OnUpdateHook/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/8OnUpdateHook/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/8OnUpdateHook/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/8OnUpdateHook/types/services/SeasonalEventService.d.ts b/TypeScript/8OnUpdateHook/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/8OnUpdateHook/types/services/SeasonalEventService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/8OnUpdateHook/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/8OnUpdateHook/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/8OnUpdateHook/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/8OnUpdateHook/types/services/mod/CustomItemService.d.ts b/TypeScript/8OnUpdateHook/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/8OnUpdateHook/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/8OnUpdateHook/types/utils/HttpResponseUtil.d.ts b/TypeScript/8OnUpdateHook/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/8OnUpdateHook/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/8OnUpdateHook/types/utils/JsonUtil.d.ts b/TypeScript/8OnUpdateHook/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/8OnUpdateHook/types/utils/JsonUtil.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/8OnUpdateHook/types/utils/MathUtil.d.ts b/TypeScript/8OnUpdateHook/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/8OnUpdateHook/types/utils/MathUtil.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/8OnUpdateHook/types/utils/RagfairOfferHolder.d.ts b/TypeScript/8OnUpdateHook/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/8OnUpdateHook/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/8OnUpdateHook/types/utils/RandomUtil.d.ts b/TypeScript/8OnUpdateHook/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/8OnUpdateHook/types/utils/RandomUtil.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/8OnUpdateHook/types/utils/TimeUtil.d.ts b/TypeScript/8OnUpdateHook/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/8OnUpdateHook/types/utils/TimeUtil.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/8OnUpdateHook/types/utils/VFS.d.ts b/TypeScript/8OnUpdateHook/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/8OnUpdateHook/types/utils/VFS.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/8OnUpdateHook/types/utils/Watermark.d.ts b/TypeScript/8OnUpdateHook/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/8OnUpdateHook/types/utils/Watermark.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/8OnUpdateHook/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/8OnUpdateHook/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/8OnUpdateHook/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/8OnUpdateHook/types/utils/collections/queue/Queue.d.ts b/TypeScript/8OnUpdateHook/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/8OnUpdateHook/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; } diff --git a/TypeScript/9RouterHooks/types/callbacks/DataCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/DataCallbacks.d.ts index 41a5a41..f7e81fe 100644 --- a/TypeScript/9RouterHooks/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/DataCallbacks.d.ts @@ -11,17 +11,17 @@ import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/9RouterHooks/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/DialogueCallbacks.d.ts index f37f487..baee279 100644 --- a/TypeScript/9RouterHooks/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/DialogueCallbacks.d.ts @@ -65,7 +65,7 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/mail/dialog/getAllAttachments * @returns IGetAllAttachmentsResponse */ - getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; + getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/msg/send */ sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; /** Handle client/friend/request/list/outbox */ diff --git a/TypeScript/9RouterHooks/types/callbacks/MatchCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/MatchCallbacks.d.ts index f002178..73f7564 100644 --- a/TypeScript/9RouterHooks/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/MatchCallbacks.d.ts @@ -16,15 +16,15 @@ import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResp import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; export declare class MatchCallbacks { protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; protected matchController: MatchController; - protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService); /** Handle client/match/updatePing */ updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/9RouterHooks/types/context/ApplicationContext.d.ts b/TypeScript/9RouterHooks/types/context/ApplicationContext.d.ts index 4818e3a..bef168a 100644 --- a/TypeScript/9RouterHooks/types/context/ApplicationContext.d.ts +++ b/TypeScript/9RouterHooks/types/context/ApplicationContext.d.ts @@ -13,8 +13,8 @@ export declare class ApplicationContext { * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue(); * ``` */ - getLatestValue(type: ContextVariableType): ContextVariable; - getValues(type: ContextVariableType): ContextVariable[]; + getLatestValue(type: ContextVariableType): ContextVariable | undefined; + getValues(type: ContextVariableType): ContextVariable[] | undefined; addValue(type: ContextVariableType, value: any): void; clearValues(type: ContextVariableType): void; } diff --git a/TypeScript/9RouterHooks/types/controllers/AchievementController.d.ts b/TypeScript/9RouterHooks/types/controllers/AchievementController.d.ts index 14a32c6..425b848 100644 --- a/TypeScript/9RouterHooks/types/controllers/AchievementController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/AchievementController.d.ts @@ -1,14 +1,14 @@ import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse"; import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; /** * Logic for handling In Raid callbacks */ export declare class AchievementController { protected logger: ILogger; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, databaseService: DatabaseService); /** * Get base achievements * @param sessionID Session id diff --git a/TypeScript/9RouterHooks/types/controllers/BotController.d.ts b/TypeScript/9RouterHooks/types/controllers/BotController.d.ts index 25f7c29..181fe67 100644 --- a/TypeScript/9RouterHooks/types/controllers/BotController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/BotController.d.ts @@ -14,8 +14,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -23,7 +23,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botGenerator: BotGenerator; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; @@ -38,7 +38,7 @@ export declare class BotController { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner); /** * Return the number of bot load-out varieties to be generated * @param type bot Type we want the load-out gen count for diff --git a/TypeScript/9RouterHooks/types/controllers/BuildController.d.ts b/TypeScript/9RouterHooks/types/controllers/BuildController.d.ts index 7b8957e..ed8adf6 100644 --- a/TypeScript/9RouterHooks/types/controllers/BuildController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/BuildController.d.ts @@ -6,8 +6,8 @@ import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuil import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -15,13 +15,13 @@ export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner); /** Handle client/handbook/builds/my/list */ getUserBuilds(sessionID: string): IUserBuilds; /** Handle client/builds/weapon/save */ diff --git a/TypeScript/9RouterHooks/types/controllers/CustomizationController.d.ts b/TypeScript/9RouterHooks/types/controllers/CustomizationController.d.ts index 613dac9..028341a 100644 --- a/TypeScript/9RouterHooks/types/controllers/CustomizationController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/CustomizationController.d.ts @@ -6,13 +6,13 @@ import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClo import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected saveServer: SaveServer; protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; @@ -20,7 +20,7 @@ export declare class CustomizationController { lowerParentId: string; upperParentId: string; }; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper); /** * Get purchasable clothing items from trader that match players side (usec/bear) * @param traderID trader to look up clothing for diff --git a/TypeScript/9RouterHooks/types/controllers/DialogueController.d.ts b/TypeScript/9RouterHooks/types/controllers/DialogueController.d.ts index 4a94359..c15d724 100644 --- a/TypeScript/9RouterHooks/types/controllers/DialogueController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/DialogueController.d.ts @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -79,7 +79,7 @@ export declare class DialogueController { * @param dialogUsers The participants of the mail * @returns IUserDialogInfo array */ - protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -116,7 +116,7 @@ export declare class DialogueController { * @param sessionId Session id * @returns IGetAllAttachmentsResponse */ - getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; + getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; /** diff --git a/TypeScript/9RouterHooks/types/controllers/GameController.d.ts b/TypeScript/9RouterHooks/types/controllers/GameController.d.ts index 6325d37..fa5debd 100644 --- a/TypeScript/9RouterHooks/types/controllers/GameController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/GameController.d.ts @@ -24,8 +24,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -40,7 +40,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class GameController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; @@ -68,7 +68,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start diff --git a/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts b/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts index 7d2510d..e9d1ed9 100644 --- a/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts @@ -29,8 +29,8 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +44,7 @@ export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; @@ -65,7 +65,7 @@ export declare class HideoutController { /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/9RouterHooks/types/controllers/InraidController.d.ts b/TypeScript/9RouterHooks/types/controllers/InraidController.d.ts index f252a7e..4aa6dad 100644 --- a/TypeScript/9RouterHooks/types/controllers/InraidController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InraidController.d.ts @@ -21,8 +21,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -38,7 +38,7 @@ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected pmcChatResponseService: PmcChatResponseService; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected questHelper: QuestHelper; @@ -62,7 +62,7 @@ export declare class InraidController { protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id diff --git a/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts b/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts index cfb05e4..00d8a05 100644 --- a/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts @@ -14,9 +14,10 @@ import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -33,7 +34,7 @@ export declare class InsuranceController { protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; @@ -43,11 +44,12 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected mailSendService: MailSendService; protected ragfairPriceService: RagfairPriceService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -181,9 +183,9 @@ export declare class InsuranceController { * * @param traderId The ID of the trader who insured the item. * @param insuredItem Optional. The item to roll for. Only used for logging. - * @returns true if the insured item should be removed from inventory, false otherwise, or null on error. + * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null; + protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; /** * Handle Insure event * Add insurance to an item diff --git a/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts b/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts index 04ddea9..bd38825 100644 --- a/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts @@ -6,6 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; @@ -30,7 +31,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -44,7 +45,7 @@ export declare class InventoryController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected fenceService: FenceService; protected presetHelper: PresetHelper; protected inventoryHelper: InventoryHelper; @@ -53,13 +54,14 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected traderHelper: TraderHelper; protected localisationService: LocalisationService; protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; protected cloner: ICloner; - constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts b/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts index 58bc7b2..46dfe26 100644 --- a/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts @@ -10,8 +10,8 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,12 +24,12 @@ export declare class LauncherController { protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected preSptModLoader: PreSptModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness" diff --git a/TypeScript/9RouterHooks/types/controllers/LocationController.d.ts b/TypeScript/9RouterHooks/types/controllers/LocationController.d.ts index f1d5e0c..727a8c8 100644 --- a/TypeScript/9RouterHooks/types/controllers/LocationController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/LocationController.d.ts @@ -12,7 +12,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -30,14 +30,14 @@ export declare class LocationController { protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected itemFilterService: ItemFilterService; protected lootGenerator: LootGenerator; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected cloner: ICloner; protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); + constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -47,7 +47,7 @@ export declare class LocationController { */ get(sessionId: string, request: IGetLocationRequestData): ILocationBase; /** - * Generate a maps base location with loot + * Generate a maps base location and loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/9RouterHooks/types/controllers/PresetController.d.ts b/TypeScript/9RouterHooks/types/controllers/PresetController.d.ts index 0098a41..0317a89 100644 --- a/TypeScript/9RouterHooks/types/controllers/PresetController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/PresetController.d.ts @@ -1,10 +1,10 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class PresetController { protected logger: ILogger; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService); initialize(): void; } diff --git a/TypeScript/9RouterHooks/types/controllers/ProfileController.d.ts b/TypeScript/9RouterHooks/types/controllers/ProfileController.d.ts index e39a632..5d35cdf 100644 --- a/TypeScript/9RouterHooks/types/controllers/ProfileController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/ProfileController.d.ts @@ -19,8 +19,8 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; @@ -32,7 +32,7 @@ export declare class ProfileController { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; @@ -44,7 +44,8 @@ export declare class ProfileController { protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + protected defaultInventoryTpl: string; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -84,9 +85,9 @@ export declare class ProfileController { protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void; /** * For each trader reset their state to what a level 1 player would see - * @param sessionID Session id of profile to reset + * @param sessionId Session id of profile to reset */ - protected resetAllTradersInProfile(sessionID: string): void; + protected resetAllTradersInProfile(sessionId: string): void; /** * Generate a player scav object * PMC profile MUST exist first before pscav can be generated diff --git a/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts b/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts index 0a32b05..94416bf 100644 --- a/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts @@ -18,7 +18,7 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; @@ -32,7 +32,7 @@ export declare class QuestController { protected timeUtil: TimeUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; @@ -47,7 +47,7 @@ export declare class QuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/quest/list * Get all quests visible to player @@ -126,7 +126,7 @@ export declare class QuestController { * @param postQuestStatuses Quests after * @returns QuestStatusChange array */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; /** * Send a popup to player on successful completion of a quest * @param sessionID session id diff --git a/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts b/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts index 9567d62..d4d4574 100644 --- a/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts @@ -28,9 +28,9 @@ import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -49,7 +49,7 @@ export declare class RagfairController { protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected saveServer: SaveServer; protected ragfairSellHelper: RagfairSellHelper; @@ -69,7 +69,7 @@ export declare class RagfairController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); /** * Handles client/ragfair/find * Returns flea offers that match required search parameters @@ -180,8 +180,8 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[] | null; - errorMessage: string | null; + items: Item[] | undefined; + errorMessage: string | undefined; }; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; diff --git a/TypeScript/9RouterHooks/types/controllers/RepairController.d.ts b/TypeScript/9RouterHooks/types/controllers/RepairController.d.ts index 61726ef..cb44bd0 100644 --- a/TypeScript/9RouterHooks/types/controllers/RepairController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/RepairController.d.ts @@ -9,13 +9,13 @@ import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRe import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { PaymentService } from "@spt/services/PaymentService"; import { RepairService } from "@spt/services/RepairService"; export declare class RepairController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; @@ -23,7 +23,7 @@ export declare class RepairController { protected repairService: RepairService; protected profileHelper: ProfileHelper; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper); /** * Handle TraderRepair event * Repair with trader diff --git a/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts b/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts index e0f3753..aa7d106 100644 --- a/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,8 @@ import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,12 +24,13 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RepeatableQuestController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; @@ -38,7 +40,7 @@ export declare class RepeatableQuestController { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/9RouterHooks/types/controllers/TradeController.d.ts b/TypeScript/9RouterHooks/types/controllers/TradeController.d.ts index 9daed8c..768aad2 100644 --- a/TypeScript/9RouterHooks/types/controllers/TradeController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/TradeController.d.ts @@ -16,8 +16,8 @@ import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; @@ -27,7 +27,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TradeController { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected timeUtil: TimeUtil; @@ -45,7 +45,7 @@ export declare class TradeController { protected roubleTpl: string; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ diff --git a/TypeScript/9RouterHooks/types/controllers/TraderController.d.ts b/TypeScript/9RouterHooks/types/controllers/TraderController.d.ts index 9a85203..7fc6d78 100644 --- a/TypeScript/9RouterHooks/types/controllers/TraderController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/TraderController.d.ts @@ -6,7 +6,7 @@ import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrade import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; @@ -15,7 +15,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; @@ -26,7 +26,7 @@ export declare class TraderController { protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService diff --git a/TypeScript/9RouterHooks/types/di/Container.d.ts b/TypeScript/9RouterHooks/types/di/Container.d.ts index e339a3b..0619968 100644 --- a/TypeScript/9RouterHooks/types/di/Container.d.ts +++ b/TypeScript/9RouterHooks/types/di/Container.d.ts @@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe"; export declare class Container { static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; + static registerPrimaryDependencies(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; private static registerRouters; diff --git a/TypeScript/9RouterHooks/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotEquipmentModGenerator.d.ts index 56f6767..ad72f80 100644 --- a/TypeScript/9RouterHooks/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotEquipmentModGenerator.d.ts @@ -17,23 +17,23 @@ import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { IFilterPlateModsForSlotByLevelResult } from "../models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "./BotInventoryGenerator"; -import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected probabilityHelper: ProbabilityHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; protected itemFilterService: ItemFilterService; @@ -49,7 +49,7 @@ export declare class BotEquipmentModGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer, cloner: ICloner); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to @@ -117,7 +117,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to choose an appropriate mod with * @returns itemHelper.getItem() result */ - protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem]; + protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; /** * Filter mod pool down based on various criteria: @@ -140,7 +140,7 @@ export declare class BotEquipmentModGenerator { * @param parentItemTpl * @returns Default preset found */ - protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset; + protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined; /** * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible * @param weapon Weapon @@ -172,7 +172,7 @@ export declare class BotEquipmentModGenerator { * @param items items to ensure picked mod is compatible with * @returns item tpl */ - protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check diff --git a/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts index 49eb70c..cb2699d 100644 --- a/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts @@ -11,8 +11,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -25,7 +25,7 @@ export declare class BotGenerator { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botInventoryGenerator: BotInventoryGenerator; protected botLevelGenerator: BotLevelGenerator; protected botEquipmentFilterService: BotEquipmentFilterService; @@ -38,7 +38,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/9RouterHooks/types/generators/BotInventoryGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotInventoryGenerator.d.ts index aa9c6cf..6815ae8 100644 --- a/TypeScript/9RouterHooks/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotInventoryGenerator.d.ts @@ -11,8 +11,8 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -20,7 +20,7 @@ export declare class BotInventoryGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; @@ -32,7 +32,7 @@ export declare class BotInventoryGenerator { 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, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, 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 diff --git a/TypeScript/9RouterHooks/types/generators/BotLevelGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotLevelGenerator.d.ts index 71fad1f..dee61e2 100644 --- a/TypeScript/9RouterHooks/types/generators/BotLevelGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotLevelGenerator.d.ts @@ -3,13 +3,13 @@ import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLev import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer); + protected databaseService: DatabaseService; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot diff --git a/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts index 4301cea..73fbf61 100644 --- a/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts @@ -15,8 +15,8 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -27,7 +27,7 @@ export declare class BotLootGenerator { protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; @@ -39,7 +39,7 @@ export declare class BotLootGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings; /** * Add loot to bots containers diff --git a/TypeScript/9RouterHooks/types/generators/BotWeaponGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotWeaponGenerator.d.ts index 42618e1..5559bfa 100644 --- a/TypeScript/9RouterHooks/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotWeaponGenerator.d.ts @@ -14,8 +14,8 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -24,7 +24,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected weightedRandomHelper: WeightedRandomHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -41,7 +41,7 @@ export declare class BotWeaponGenerator { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected repairConfig: IRepairConfig; - constructor(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[], cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster diff --git a/TypeScript/9RouterHooks/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/FenceBaseAssortGenerator.d.ts index b8c9266..784022f 100644 --- a/TypeScript/9RouterHooks/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,7 +6,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -15,7 +15,7 @@ import { HashUtil } from "@spt/utils/HashUtil"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -25,7 +25,7 @@ export declare class FenceBaseAssortGenerator { protected configServer: ConfigServer; protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ @@ -39,9 +39,9 @@ export declare class FenceBaseAssortGenerator { /** * Get the penetration power value of an ammo, works with ammo boxes and raw ammos * @param rootItemDb Ammo box or ammo item from items.db - * @returns Penetration power of passed in item, null if it doesnt have a power + * @returns Penetration power of passed in item, undefined if it doesnt have a power */ - protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/9RouterHooks/types/generators/LocationGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/LocationGenerator.d.ts index 7571e14..96c0ecd 100644 --- a/TypeScript/9RouterHooks/types/generators/LocationGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/LocationGenerator.d.ts @@ -8,7 +8,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -28,7 +28,7 @@ export interface IContainerGroupCount { } export declare class LocationGenerator { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected objectId: ObjectId; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; @@ -40,7 +40,7 @@ export declare class LocationGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for @@ -143,6 +143,6 @@ export declare class LocationGenerator { * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item; + protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/9RouterHooks/types/generators/LootGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/LootGenerator.d.ts index 79b8183..c3c71db 100644 --- a/TypeScript/9RouterHooks/types/generators/LootGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/LootGenerator.d.ts @@ -9,7 +9,7 @@ import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/ import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; @@ -22,7 +22,7 @@ type ItemLimit = { export declare class LootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -31,7 +31,7 @@ export declare class LootGenerator { protected localisationService: LocalisationService; protected ragfairLinkedItemService: RagfairLinkedItemService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/TypeScript/9RouterHooks/types/generators/PMCLootGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/PMCLootGenerator.d.ts index 9f6bcdc..1da27ef 100644 --- a/TypeScript/9RouterHooks/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/PMCLootGenerator.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -13,7 +13,7 @@ import { SeasonalEventService } from "@spt/services/SeasonalEventService"; */ export declare class PMCLootGenerator { protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; @@ -24,7 +24,7 @@ export declare class PMCLootGenerator { protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; protected roubleTpl: string; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); + constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls diff --git a/TypeScript/9RouterHooks/types/generators/PlayerScavGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/PlayerScavGenerator.d.ts index da874fc..2414150 100644 --- a/TypeScript/9RouterHooks/types/generators/PlayerScavGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/PlayerScavGenerator.d.ts @@ -9,9 +9,9 @@ import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -20,7 +20,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -34,7 +34,7 @@ export declare class PlayerScavGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts index cd129a7..707ba95 100644 --- a/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts @@ -13,8 +13,8 @@ import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/ import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; @@ -28,7 +28,7 @@ export declare class RagfairOfferGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairServerHelper: RagfairServerHelper; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; @@ -51,7 +51,7 @@ export declare class RagfairOfferGenerator { }[]; /** Internal counter to ensure each offer created has a unique value for its intId property */ protected offerCounter: number; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/9RouterHooks/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/RepeatableQuestGenerator.d.ts index 2b68eef..77c4e79 100644 --- a/TypeScript/9RouterHooks/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/RepeatableQuestGenerator.d.ts @@ -9,7 +9,7 @@ import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } f import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected objectId: ObjectId; @@ -28,7 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest diff --git a/TypeScript/9RouterHooks/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/RepeatableQuestRewardGenerator.d.ts index ea750dd..7dc88aa 100644 --- a/TypeScript/9RouterHooks/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -19,7 +19,7 @@ export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected handbookHelper: HandbookHelper; @@ -30,7 +30,7 @@ export declare class RepeatableQuestRewardGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/9RouterHooks/types/generators/ScavCaseRewardGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/ScavCaseRewardGenerator.d.ts index f22dcfc..45f2e51 100644 --- a/TypeScript/9RouterHooks/types/generators/ScavCaseRewardGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/ScavCaseRewardGenerator.d.ts @@ -7,7 +7,7 @@ import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; @@ -22,7 +22,7 @@ export declare class ScavCaseRewardGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; @@ -30,7 +30,7 @@ export declare class ScavCaseRewardGenerator { protected scavCaseConfig: IScavCaseConfig; protected dbItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[]; - constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build * @param recipeId recipe of the scav case craft diff --git a/TypeScript/9RouterHooks/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts b/TypeScript/9RouterHooks/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts index c2b496f..635332b 100644 --- a/TypeScript/9RouterHooks/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts +++ b/TypeScript/9RouterHooks/types/generators/weapongen/implementations/ExternalInventoryMagGen.d.ts @@ -23,5 +23,5 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen { * @param weaponTpl Weapon to get mag for * @returns tpl of magazine */ - protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem; + protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem | undefined; } diff --git a/TypeScript/9RouterHooks/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/BotDifficultyHelper.d.ts index a5447a5..facc597 100644 --- a/TypeScript/9RouterHooks/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/BotDifficultyHelper.d.ts @@ -3,20 +3,20 @@ import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotDifficultyHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); /** * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' diff --git a/TypeScript/9RouterHooks/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/BotGeneratorHelper.d.ts index bb3526f..00ae8ae 100644 --- a/TypeScript/9RouterHooks/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/BotGeneratorHelper.d.ts @@ -12,13 +12,13 @@ import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/mo import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotGeneratorHelper { protected logger: ILogger; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; protected inventoryHelper: InventoryHelper; @@ -28,7 +28,7 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability @@ -50,24 +50,24 @@ export declare class BotGeneratorHelper { * Get the chance for the weapon attachment or helmet equipment to be set as activated * @param botRole role of bot with weapon/helmet * @param setting the setting of the weapon attachment/helmet equipment to be activated - * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is undefined * @returns Percent chance to be active */ - protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; + protected getBotEquipmentSettingFromConfig(botRole: string | undefined, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict diff --git a/TypeScript/9RouterHooks/types/helpers/BotHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/BotHelper.d.ts index 9e2fa69..811306b 100644 --- a/TypeScript/9RouterHooks/types/helpers/BotHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/BotHelper.d.ts @@ -4,16 +4,16 @@ import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotHelper { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db * @param role botRole to get template for @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role diff --git a/TypeScript/9RouterHooks/types/helpers/ContainerHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/ContainerHelper.d.ts index 37aef05..730f20f 100644 --- a/TypeScript/9RouterHooks/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/ContainerHelper.d.ts @@ -1,9 +1,9 @@ export declare class FindSlotResult { success: boolean; - x: any; - y: any; + x?: number; + y?: number; rotation: boolean; - constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); + constructor(success?: boolean, x?: number, y?: number, rotation?: boolean); } export declare class ContainerHelper { /** diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index bcd2bee..ab02e4f 100644 --- a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -3,10 +3,12 @@ import { ISptCommand } from "@spt/helpers/Dialogue/Commando/SptCommands/ISptComm import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; + protected localisationService: LocalisationService; protected sptCommands: ISptCommand[]; - constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, localisationService: LocalisationService, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 3cfc7bd..247f908 100644 --- a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -16,7 +16,7 @@ export declare class TraderSptCommand implements ISptCommand { protected presetHelper: PresetHelper; protected mailSendService: MailSendService; protected localeService: LocaleService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; /** * Regex to account for all these cases: * spt trader prapor rep 100 @@ -24,7 +24,7 @@ export declare class TraderSptCommand implements ISptCommand { */ private static commandRegex; protected savedCommand: SavedCommand; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseService: DatabaseService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/9RouterHooks/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/DurabilityLimitsHelper.d.ts index 4cbac6b..e3b4086 100644 --- a/TypeScript/9RouterHooks/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/DurabilityLimitsHelper.d.ts @@ -15,14 +15,14 @@ export declare class DurabilityLimitsHelper { * @param botRole Role of bot to get max durability for * @returns Max durability of weapon */ - getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get max durability value for armor based on bot role * @param itemTemplate Item to get max durability for * @param botRole Role of bot to get max durability for * @returns max durability */ - getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole?: string): number; /** * Get randomised current weapon durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -30,7 +30,7 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of weapon * @returns Current weapon durability */ - getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; /** * Get randomised current armor durability by bot role * @param itemTemplate Unused - Item to get current durability of @@ -38,17 +38,17 @@ export declare class DurabilityLimitsHelper { * @param maxDurability Max durability of armor * @returns Current armor durability */ - getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - protected generateMaxWeaponDurability(botRole: string): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string | undefined, maxDurability: number): number; + protected generateMaxWeaponDurability(botRole?: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; - protected getLowestMaxWeaponFromConfig(botRole: string): number; - protected getHighestMaxWeaponDurabilityFromConfig(botRole: string): number; - protected generateWeaponDurability(botRole: string, maxDurability: number): number; - protected generateArmorDurability(botRole: string, maxDurability: number): number; - protected getMinWeaponDeltaFromConfig(botRole: string): number; - protected getMaxWeaponDeltaFromConfig(botRole: string): number; - protected getMinArmorDeltaFromConfig(botRole: string): number; - protected getMaxArmorDeltaFromConfig(botRole: string): number; - protected getMinArmorLimitPercentFromConfig(botRole: string): number; - protected getMinWeaponLimitPercentFromConfig(botRole: string): number; + protected getLowestMaxWeaponFromConfig(botRole?: string): number; + protected getHighestMaxWeaponDurabilityFromConfig(botRole?: string): number; + protected generateWeaponDurability(botRole: string | undefined, maxDurability: number): number; + protected generateArmorDurability(botRole: string | undefined, maxDurability: number): number; + protected getMinWeaponDeltaFromConfig(botRole?: string): number; + protected getMaxWeaponDeltaFromConfig(botRole?: string): number; + protected getMinArmorDeltaFromConfig(botRole?: string): number; + protected getMaxArmorDeltaFromConfig(botRole?: string): number; + protected getMinArmorLimitPercentFromConfig(botRole?: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole?: string): number; } diff --git a/TypeScript/9RouterHooks/types/helpers/HandbookHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/HandbookHelper.d.ts index 6836875..0ed965e 100644 --- a/TypeScript/9RouterHooks/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/HandbookHelper.d.ts @@ -2,7 +2,7 @@ import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; declare class LookupItem { readonly byId: Map; @@ -15,13 +15,13 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected cloner: ICloner; protected itemConfig: IItemConfig; protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; - constructor(databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); /** * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class */ @@ -29,7 +29,7 @@ export declare class HandbookHelper { /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) * If no values found, return 0 - * @param tpl item tpl to look up price for + * @param tpl Item tpl to look up price for * @returns price in roubles */ getTemplatePrice(tpl: string): number; diff --git a/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts index 33a9729..fefad98 100644 --- a/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts @@ -15,7 +15,7 @@ import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -26,7 +26,7 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; @@ -43,7 +43,7 @@ export declare class HideoutHelper { static expeditionaryFuelTank: string; static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * Add production to profiles' Hideout.Production array * @param pmcData Profile to add production to @@ -202,7 +202,7 @@ export declare class HideoutHelper { */ protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object diff --git a/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts index 45cb9c1..e6fe5e4 100644 --- a/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts @@ -10,8 +10,8 @@ import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,7 +23,7 @@ export declare class InRaidHelper { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected itemHelper: ItemHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; @@ -35,7 +35,7 @@ export declare class InRaidHelper { protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory diff --git a/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts index 718dcdd..34a2973 100644 --- a/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts @@ -5,7 +5,7 @@ import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; @@ -24,7 +24,7 @@ export declare class ItemHelper { protected randomUtil: RandomUtil; protected objectId: ObjectId; protected mathUtil: MathUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; @@ -33,7 +33,7 @@ export declare class ItemHelper { protected compareUtil: CompareUtil; protected cloner: ICloner; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil, cloner: ICloner); /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -258,7 +258,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -287,9 +287,9 @@ export declare class ItemHelper { * * @param item The item to be checked * @param parent The parent of the item to be checked - * @returns True if the item is actually moddable, false if it is not, and null if the check cannot be performed. + * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | null; + isRaidModdable(item: Item, parent: Item): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -304,9 +304,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the main parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the top-most parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | null; + getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * @@ -327,9 +327,9 @@ export declare class ItemHelper { * * @param itemId - The unique identifier of the item for which to find the equipment parent. * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. - * @returns The Item object representing the equipment parent of the given item, or `null` if no such parent exists. + * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | null; + getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; /** * Get the inventory size of an item * @param items Item with children @@ -342,7 +342,7 @@ export declare class ItemHelper { * @param item Db item template to look up Cartridge filter values from * @returns Caliber of cartridge */ - getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | null; + getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string | undefined; /** * Add cartridges to the ammo box with correct max stack sizes * @param ammoBox Box to add cartridges to @@ -396,7 +396,7 @@ export declare class ItemHelper { * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string | undefined; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -419,6 +419,11 @@ export declare class ItemHelper { * @returns Name of item */ getItemName(itemTpl: string): string; + /** + * Get all item tpls with a desired base type + * @param desiredBaseType Item base type wanted + * @returns Array of tpls + */ getItemTplsOfBaseType(desiredBaseType: string): string[]; /** * Add child slot items to an item, chooses random child item if multiple choices exist @@ -433,9 +438,9 @@ export declare class ItemHelper { * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow - * @returns Chosen tpl or null + * @returns Chosen tpl or undefined */ - getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string; + getCompatibleTplFromArray(possibleTpls: string[], incompatibleModTpls: Set): string | undefined; /** * Is the provided item._props.Slots._name property a plate slot * @param slotName Name of slot (_name) of Items Slot array diff --git a/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts index 937e225..5fc8a7c 100644 --- a/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts @@ -44,7 +44,7 @@ export declare class PresetHelper { * @param templateId Item id to get preset for * @returns Null if no default preset, otherwise IPreset */ - getDefaultPreset(templateId: string): IPreset; + getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; /** * Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists diff --git a/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts index 298ec55..37937ff 100644 --- a/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts @@ -97,13 +97,19 @@ export declare class ProfileHelper { * @param sessionID Profile id to get * @returns ISptProfile object */ - getFullProfile(sessionID: string): ISptProfile; + getFullProfile(sessionID: string): ISptProfile | undefined; /** * Get a PMC profile by its session id * @param sessionID Profile id to return * @returns IPmcData object */ - getPmcProfile(sessionID: string): IPmcData; + getPmcProfile(sessionID: string): IPmcData | undefined; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; /** * Get a full profiles scav-specific sub-profile * @param sessionID Profiles id diff --git a/TypeScript/9RouterHooks/types/helpers/RagfairHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/RagfairHelper.d.ts index cab2148..4f45bba 100644 --- a/TypeScript/9RouterHooks/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/RagfairHelper.d.ts @@ -8,13 +8,13 @@ import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairHelper { protected logger: ILogger; protected traderAssortHelper: TraderAssortHelper; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected ragfairLinkedItemService: RagfairLinkedItemService; @@ -22,7 +22,7 @@ export declare class RagfairHelper { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, traderAssortHelper: TraderAssortHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, ragfairLinkedItemService: RagfairLinkedItemService, utilityHelper: UtilityHelper, configServer: ConfigServer, cloner: ICloner); /** * Gets currency TAG from TPL * @param {string} currency diff --git a/TypeScript/9RouterHooks/types/helpers/RagfairSellHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/RagfairSellHelper.d.ts index d694d6a..dfea2a8 100644 --- a/TypeScript/9RouterHooks/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/RagfairSellHelper.d.ts @@ -2,17 +2,17 @@ import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles diff --git a/TypeScript/9RouterHooks/types/helpers/RagfairServerHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/RagfairServerHelper.d.ts index 84d2929..927caf5 100644 --- a/TypeScript/9RouterHooks/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/RagfairServerHelper.d.ts @@ -7,9 +7,10 @@ import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -22,18 +23,19 @@ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; protected mailSendService: MailSendService; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -58,12 +60,6 @@ export declare class RagfairServerHelper { * @returns True if id was a trader */ isTrader(traderId: string): boolean; - /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player - */ - isPlayer(userId: string): boolean; /** * Send items back to player * @param sessionID Player to send items to diff --git a/TypeScript/9RouterHooks/types/helpers/TraderAssortHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/TraderAssortHelper.d.ts index 50f6933..faf2a9d 100644 --- a/TypeScript/9RouterHooks/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/TraderAssortHelper.d.ts @@ -48,6 +48,12 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Given the blacklist provided, remove root items from assort + * @param assortToFilter Trader assort to modify + * @param itemsTplsToRemove Item TPLs the assort should not have + */ + protected removeItemsFromAssort(assortToFilter: ITraderAssort, itemsTplsToRemove: string[]): void; /** * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust diff --git a/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts index aca9d87..5f515da 100644 --- a/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts @@ -5,12 +5,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; @@ -19,7 +19,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; @@ -31,10 +30,10 @@ export declare class TraderHelper { protected configServer: ConfigServer; protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ - protected highestTraderPriceItems: Record; + protected highestTraderPriceItems?: Record; /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); + protected highestTraderBuyPriceItems?: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile * when trader not found in profile @@ -42,7 +41,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase; + getTrader(traderID: string, sessionID: string): ITraderBase | undefined; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for @@ -55,7 +54,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item; + getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -70,6 +69,12 @@ export declare class TraderHelper { * @returns Standing value */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + /** + * Add an array of suit ids to a profiles suit array, no duplicates + * @param fullProfile Profile to add to + * @param suitIds Suit Ids to add + */ + protected addSuitsToProfile(fullProfile: ISptProfile, suitIds: string[]): void; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -91,10 +96,16 @@ export declare class TraderHelper { * @returns current standing + added standing (clamped if needed) */ protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; + /** + * iterate over a profiles traders and ensure they have the correct loyaltyLevel for the player + * @param sessionId Profile to check + */ + validateTraderStandingsAndPlayerLevelForProfile(sessionId: string): void; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to check standing of - * @param pmcData profile to update trader in + * Also validates and updates player level if not correct based on XP value + * @param traderID Trader to check standing of + * @param pmcData Profile to update trader in */ lvlUp(traderID: string, pmcData: IPmcData): void; /** @@ -108,7 +119,7 @@ export declare class TraderHelper { * @param traderId Trader to look up * @returns Time in seconds */ - getTraderUpdateSeconds(traderId: string): number; + getTraderUpdateSeconds(traderId: string): number | undefined; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile @@ -140,7 +151,7 @@ export declare class TraderHelper { * @param traderId Traders id * @returns Traders key */ - getTraderById(traderId: string): Traders; + getTraderById(traderId: string): Traders | undefined; /** * Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the * same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. 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 8c747fc..06c1604 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts @@ -83,7 +83,7 @@ export interface Settings { AggressorBonus: number; } export interface IBan { - type: BanType; + banType: BanType; dateTime: number; } export declare enum BanType { @@ -163,7 +163,7 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { - Eft: IEftStats; + Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; 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 4d73192..1615a25 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -5,6 +5,8 @@ export interface IProfileTemplates { "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; + "Unheard": IProfileSides; + "Tournament": IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -28,4 +30,10 @@ export interface ProfileTraderTemplate { initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; + /** How many days is usage of the flea blocked for upon profile creation */ + fleaBlockedDays?: number; + /** What traders default to being locked on profile creation */ + lockedByDefaultOverride?: string[]; + /** What traders should have their clothing unlocked/purchased on creation */ + purchaseAllClothingByDefaultForTrader?: string[]; } 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 32bc9fc..a8ccfbb 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/ITemplateItem.d.ts @@ -3,9 +3,9 @@ export interface ITemplateItem { _id: string; _name: string; _parent: string; - _type: string; + _type: ItemType; _props: Props; - _proto: string; + _proto?: string; } export interface Props { AllowSpawnOnLocations?: any[]; @@ -529,3 +529,7 @@ export interface IShotsGroupSettings { ShotRecoilRotationStrength: Ixyz; StartShotIndex: number; } +export declare enum ItemType { + NODE = "Node", + ITEM = "Item" +} diff --git a/TypeScript/9RouterHooks/types/models/eft/game/IGameModeRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/game/IGameModeRequestData.d.ts index 618c42d..57ff27b 100644 --- a/TypeScript/9RouterHooks/types/models/eft/game/IGameModeRequestData.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/game/IGameModeRequestData.d.ts @@ -1,3 +1,3 @@ export interface IGameModeRequestData { - sessionMode: string | null; + sessionMode: string | undefined; } diff --git a/TypeScript/9RouterHooks/types/models/eft/game/IGetRaidTimeResponse.d.ts b/TypeScript/9RouterHooks/types/models/eft/game/IGetRaidTimeResponse.d.ts index 4dcf0a0..3fd248e 100644 --- a/TypeScript/9RouterHooks/types/models/eft/game/IGetRaidTimeResponse.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/game/IGetRaidTimeResponse.d.ts @@ -1,6 +1,6 @@ export interface IGetRaidTimeResponse { RaidTimeMinutes: number; - NewSurviveTimeSeconds: number; + NewSurviveTimeSeconds?: number; OriginalSurvivalTimeSeconds: number; ExitChanges: ExtractChange[]; } diff --git a/TypeScript/9RouterHooks/types/models/eft/httpResponse/INullResponseData.d.ts b/TypeScript/9RouterHooks/types/models/eft/httpResponse/INullResponseData.d.ts index a3ae838..26dc461 100644 --- a/TypeScript/9RouterHooks/types/models/eft/httpResponse/INullResponseData.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/httpResponse/INullResponseData.d.ts @@ -1,5 +1,5 @@ export interface INullResponseData { err: number; errmsg: any; - data: null; + data: undefined; } diff --git a/TypeScript/9RouterHooks/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/TypeScript/9RouterHooks/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index c19ba2f..7091f44 100644 --- a/TypeScript/9RouterHooks/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -4,7 +4,7 @@ export interface IAddItemsDirectRequest { itemsWithModsToAdd: Item[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ - callback: (buyCount: number) => void; + callback?: (buyCount: number) => void; /** Should sorting table be used when no space found in stash */ useSortingTable: boolean; } diff --git a/TypeScript/9RouterHooks/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/9RouterHooks/types/models/eft/profile/ISptProfile.d.ts index f6e6379..8ebf223 100644 --- a/TypeScript/9RouterHooks/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/profile/ISptProfile.d.ts @@ -86,7 +86,7 @@ export interface Dialogue { export interface IUserDialogInfo { _id: string; aid: number; - Info: IUserDialogDetails; + Info?: IUserDialogDetails; } export interface IUserDialogDetails { Nickname: string; @@ -160,9 +160,14 @@ export interface DateTime { time: string; } export interface Spt { + /** What version of SPT was this profile made with */ version: string; + /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; + /** What gifts has this profile received and how many */ receivedGifts: ReceivedGift[]; + /** item TPLs blacklisted from being sold on flea for this profile */ + blacklistedItemTpls?: string[]; } export interface ModDetails { name: string; diff --git a/TypeScript/9RouterHooks/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/9RouterHooks/types/models/enums/WildSpawnTypeNumber.d.ts index 80d737e..19d0062 100644 --- a/TypeScript/9RouterHooks/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/WildSpawnTypeNumber.d.ts @@ -49,8 +49,8 @@ export declare enum WildSpawnTypeNumber { SPIRITSPRING = 48, PMCBEAR = 49, PMCUSEC = 50, - skier = 51, - peacemaker = 52, + SKIER = 51, + PEACEMAKER = 52, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/TypeScript/9RouterHooks/types/models/spt/bots/IBots.d.ts b/TypeScript/9RouterHooks/types/models/spt/bots/IBots.d.ts new file mode 100644 index 0000000..f413be4 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/spt/bots/IBots.d.ts @@ -0,0 +1,8 @@ +import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +export interface IBots { + types: Record; + base: IBotBase; + core: IBotCore; +} diff --git a/TypeScript/9RouterHooks/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts b/TypeScript/9RouterHooks/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts similarity index 100% rename from TypeScript/9RouterHooks/types/generators/IFilterPlateModsForSlotByLevelResult.d.ts rename to TypeScript/9RouterHooks/types/models/spt/bots/IFilterPlateModsForSlotByLevelResult.d.ts diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts index 3343c0d..b0bc491 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts @@ -41,6 +41,8 @@ export interface IBotConfig extends IBaseConfig { currencyStackSize: Record>>; /** Tpls for low profile gas blocks */ lowProfileGasBlockTpls: string[]; + /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ + disableLootOnBotTypes: string[]; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IInsuranceConfig.d.ts index a5056a5..2bbd7b3 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IInsuranceConfig.d.ts @@ -1,8 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInsuranceConfig extends IBaseConfig { kind: "spt-insurance"; - /** Insurance price multiplier */ - insuranceMultiplier: Record; /** Chance item is returned as insurance, keyed by trader id */ returnChancePercent: Record; /** Item slots that should never be returned as insurance */ diff --git a/TypeScript/9RouterHooks/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/9RouterHooks/types/models/spt/dialog/ISendMessageDetails.d.ts index 379b032..1625f47 100644 --- a/TypeScript/9RouterHooks/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -40,5 +40,7 @@ export declare enum ProfileChangeEventType { PROFILE_LEVEL = "ProfileLevel", SKILL_POINTS = "SkillPoints", EXAMINE_ALL_ITEMS = "ExamineAllItems", - UNLOCK_TRADER = "UnlockTrader" + UNLOCK_TRADER = "UnlockTrader", + ASSORT_UNLOCK_RULE = "AssortmentUnlockRule", + HIDEOUT_AREA_LEVEL = "HideoutAreaLevel" } diff --git a/TypeScript/9RouterHooks/types/models/spt/hideout/IHideout.d.ts b/TypeScript/9RouterHooks/types/models/spt/hideout/IHideout.d.ts new file mode 100644 index 0000000..57fed47 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/spt/hideout/IHideout.d.ts @@ -0,0 +1,12 @@ +import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; +import { IQteData } from "@spt/models/eft/hideout/IQteData"; +export interface IHideout { + areas: IHideoutArea[]; + production: IHideoutProduction[]; + scavcase: IHideoutScavCase[]; + settings: IHideoutSettingsBase; + qte: IQteData[]; +} diff --git a/TypeScript/9RouterHooks/types/models/spt/server/ExhaustableArray.d.ts b/TypeScript/9RouterHooks/types/models/spt/server/ExhaustableArray.d.ts index 2419acf..c27f41f 100644 --- a/TypeScript/9RouterHooks/types/models/spt/server/ExhaustableArray.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/server/ExhaustableArray.d.ts @@ -6,12 +6,12 @@ export declare class ExhaustableArray implements IExhaustableArray { private cloner; private pool; constructor(itemPool: T[], randomUtil: RandomUtil, cloner: ICloner); - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } export interface IExhaustableArray { - getRandomValue(): T; - getFirstValue(): T; + getRandomValue(): T | undefined; + getFirstValue(): T | undefined; hasValues(): boolean; } diff --git a/TypeScript/9RouterHooks/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/9RouterHooks/types/models/spt/server/IDatabaseTables.d.ts index 3a98412..8e4bc6a 100644 --- a/TypeScript/9RouterHooks/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/server/IDatabaseTables.d.ts @@ -1,58 +1,20 @@ import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; -import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; -import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { IQuest } from "@spt/models/eft/common/tables/IQuest"; -import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITrader } from "@spt/models/eft/common/tables/ITrader"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; -import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; import { ILocations } from "@spt/models/spt/server/ILocations"; import { IServerBase } from "@spt/models/spt/server/IServerBase"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; export interface IDatabaseTables { - bots?: { - types: Record; - base: IBotBase; - core: IBotCore; - }; - hideout?: { - areas: IHideoutArea[]; - production: IHideoutProduction[]; - scavcase: IHideoutScavCase[]; - settings: IHideoutSettingsBase; - qte: IQteData[]; - }; + bots?: IBots; + hideout?: IHideout; locales?: ILocaleBase; locations?: ILocations; match?: IMatch; - templates?: { - character: string[]; - items: Record; - quests: Record; - repeatableQuests: IRepeatableQuestDatabase; - handbook: IHandbookBase; - customization: Record; - /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ - profiles: IProfileTemplates; - /** Flea prices of items - gathered from online flea market dump */ - prices: Record; - /** Default equipment loadouts that show on main inventory screen */ - defaultEquipmentPresets: IDefaultEquipmentPreset[]; - /** Achievements */ - achievements: IAchievement[]; - }; + templates?: ITemplates; traders?: Record; globals?: IGlobals; server?: IServerBase; diff --git a/TypeScript/9RouterHooks/types/models/spt/templates/ITemplates.d.ts b/TypeScript/9RouterHooks/types/models/spt/templates/ITemplates.d.ts new file mode 100644 index 0000000..c2ebbf9 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/spt/templates/ITemplates.d.ts @@ -0,0 +1,24 @@ +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfile"; +export interface ITemplates { + character: string[]; + items: Record; + quests: Record; + repeatableQuests: IRepeatableQuestDatabase; + handbook: IHandbookBase; + customization: Record; + /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ + profiles: IProfileTemplates; + /** Flea prices of items - gathered from online flea market dump */ + prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IDefaultEquipmentPreset[]; + /** Achievements */ + achievements: IAchievement[]; +} diff --git a/TypeScript/9RouterHooks/types/routers/EventOutputHolder.d.ts b/TypeScript/9RouterHooks/types/routers/EventOutputHolder.d.ts index a943e2b..9a57df9 100644 --- a/TypeScript/9RouterHooks/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/9RouterHooks/types/routers/EventOutputHolder.d.ts @@ -44,7 +44,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/9RouterHooks/types/servers/SaveServer.d.ts b/TypeScript/9RouterHooks/types/servers/SaveServer.d.ts index f71fbb2..4e3df75 100644 --- a/TypeScript/9RouterHooks/types/servers/SaveServer.d.ts +++ b/TypeScript/9RouterHooks/types/servers/SaveServer.d.ts @@ -44,6 +44,7 @@ export declare class SaveServer { * @returns ISptProfile */ getProfile(sessionId: string): ISptProfile; + profileExists(id: string): boolean; /** * Get all profiles from memory * @returns Dictionary of ISptProfile diff --git a/TypeScript/9RouterHooks/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/TypeScript/9RouterHooks/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 10c8a74..9c41fab 100644 --- a/TypeScript/9RouterHooks/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/TypeScript/9RouterHooks/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,4 +1,5 @@ /// +/// import { IncomingMessage } from "http"; import { WebSocket } from "ws"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; @@ -20,7 +21,7 @@ export declare class SptWebSocketConnectionHandler implements IWebSocketConnecti protected httpConfig: IHttpConfig; protected webSockets: Map; protected defaultNotification: IWsNotificationEvent; - protected websocketPingHandler: any; + protected websocketPingHandler: NodeJS.Timeout | undefined; constructor(logger: ILogger, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, sptWebSocketMessageHandlers: ISptWebSocketMessageHandler[]); getSocketId(): string; getHookUrl(): string; diff --git a/TypeScript/9RouterHooks/types/services/BotEquipmentFilterService.d.ts b/TypeScript/9RouterHooks/types/services/BotEquipmentFilterService.d.ts index 5ee2fb4..780d7a2 100644 --- a/TypeScript/9RouterHooks/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/9RouterHooks/types/services/BotEquipmentFilterService.d.ts @@ -44,35 +44,35 @@ export declare class BotEquipmentFilterService { * @param botEquipmentRole equipment role of bot to look up * @returns Dictionary of weapon type and their whitelisted scope types */ - getBotWeaponSightWhitelist(botEquipmentRole: string): Record; + getBotWeaponSightWhitelist(botEquipmentRole: string): Record | undefined; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/9RouterHooks/types/services/BotLootCacheService.d.ts b/TypeScript/9RouterHooks/types/services/BotLootCacheService.d.ts index 57d56af..2b51c5b 100644 --- a/TypeScript/9RouterHooks/types/services/BotLootCacheService.d.ts +++ b/TypeScript/9RouterHooks/types/services/BotLootCacheService.d.ts @@ -79,7 +79,7 @@ export declare class BotLootCacheService { */ protected botRoleExistsInCache(botRole: string): boolean; /** - * If lootcache is null, init with empty property arrays + * If lootcache is undefined, init with empty property arrays * @param botRole Bot role to hydrate */ protected initCacheForBotRole(botRole: string): void; diff --git a/TypeScript/9RouterHooks/types/services/DatabaseService.d.ts b/TypeScript/9RouterHooks/types/services/DatabaseService.d.ts new file mode 100644 index 0000000..4d42d2d --- /dev/null +++ b/TypeScript/9RouterHooks/types/services/DatabaseService.d.ts @@ -0,0 +1,113 @@ +import { IGlobals } from "@spt/models/eft/common/IGlobals"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; +import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IMatch } from "@spt/models/eft/common/tables/IMatch"; +import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { IQuest } from "@spt/models/eft/common/tables/IQuest"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITrader } from "@spt/models/eft/common/tables/ITrader"; +import { IBots } from "@spt/models/spt/bots/IBots"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IHideout } from "@spt/models/spt/hideout/IHideout"; +import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; +import { ILocaleBase } from "@spt/models/spt/server/ILocaleBase"; +import { ILocations } from "@spt/models/spt/server/ILocations"; +import { IServerBase } from "@spt/models/spt/server/IServerBase"; +import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; +import { ITemplates } from "@spt/models/spt/templates/ITemplates"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class DatabaseService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + /** + * @returns assets/database/ + */ + getTables(): IDatabaseTables; + /** + * @returns assets/database/bots/ + */ + getBots(): IBots; + /** + * @returns assets/database/globals.json + */ + getGlobals(): IGlobals; + /** + * @returns assets/database/hideout/ + */ + getHideout(): IHideout; + /** + * @returns assets/database/locales/ + */ + getLocales(): ILocaleBase; + /** + * @returns assets/database/locations + */ + getLocations(): ILocations; + /** + * Get specific location by its Id + * @param locationId Desired trader id + * @returns assets/database/locations/ + */ + getLocation(locationId: string): ILocation; + /** + * @returns assets/database/match/ + */ + getMatch(): IMatch; + /** + * @returns assets/database/server.json + */ + getServer(): IServerBase; + /** + * @returns assets/database/settings.json + */ + getSettings(): ISettingsBase; + /** + * @returns assets/database/templates/ + */ + getTemplates(): ITemplates; + /** + * @returns assets/database/templates/achievements.json + */ + getAchievements(): IAchievement[]; + /** + * @returns assets/database/templates/customisation.json + */ + getCustomization(): Record; + /** + * @returns assets/database/templates/items.json + */ + getHandbook(): IHandbookBase; + /** + * @returns assets/database/templates/items.json + */ + getItems(): Record; + /** + * @returns assets/database/templates/prices.json + */ + getPrices(): Record; + /** + * @returns assets/database/templates/profiles.json + */ + getProfiles(): IProfileTemplates; + /** + * @returns assets/database/templates/items.json + */ + getQuests(): Record; + /** + * @returns assets/database/traders/ + */ + getTraders(): Record; + /** + * Get specific trader by their Id + * @param traderId Desired trader id + * @returns assets/database/traders/ + */ + getTrader(traderId: string): ITrader; +} diff --git a/TypeScript/9RouterHooks/types/services/FenceService.d.ts b/TypeScript/9RouterHooks/types/services/FenceService.d.ts index 0e75ae6..786573f 100644 --- a/TypeScript/9RouterHooks/types/services/FenceService.d.ts +++ b/TypeScript/9RouterHooks/types/services/FenceService.d.ts @@ -11,7 +11,7 @@ import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAss import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -24,7 +24,7 @@ export declare class FenceService { protected logger: ILogger; protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; @@ -35,13 +35,13 @@ export declare class FenceService { /** Time when some items in assort will be replaced */ protected nextPartialRefreshTimestamp: number; /** Main assorts you see at all rep levels */ - protected fenceAssort: ITraderAssort; + protected fenceAssort?: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ - protected fenceDiscountAssort: ITraderAssort; + protected fenceDiscountAssort?: ITraderAssort; /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; protected fenceItemUpdCompareProperties: Set; - constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with @@ -56,12 +56,12 @@ export declare class FenceService { * Get main fence assort * @return ITraderAssort */ - getMainFenceAssort(): ITraderAssort; + getMainFenceAssort(): ITraderAssort | undefined; /** * Get discount fence assort * @return ITraderAssort */ - getDiscountFenceAssort(): ITraderAssort; + getDiscountFenceAssort(): ITraderAssort | undefined; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -217,7 +217,7 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -239,7 +239,7 @@ export declare class FenceService { }>, itemTpl: string): { current: number; max: number; - }; + } | undefined; /** * Find presets in base fence assort and add desired number to 'assorts' parameter * @param desiredWeaponPresetsCount diff --git a/TypeScript/9RouterHooks/types/services/GiftService.d.ts b/TypeScript/9RouterHooks/types/services/GiftService.d.ts index aca276c..a379fa3 100644 --- a/TypeScript/9RouterHooks/types/services/GiftService.d.ts +++ b/TypeScript/9RouterHooks/types/services/GiftService.d.ts @@ -36,13 +36,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string; + protected getSenderId(giftData: Gift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType; + protected getMessageType(giftData: Gift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/TypeScript/9RouterHooks/types/services/InsuranceService.d.ts b/TypeScript/9RouterHooks/types/services/InsuranceService.d.ts index 5492a56..c54f9f9 100644 --- a/TypeScript/9RouterHooks/types/services/InsuranceService.d.ts +++ b/TypeScript/9RouterHooks/types/services/InsuranceService.d.ts @@ -163,11 +163,11 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. - * - * @returns The ID. + * @param sessionID Players id + * @returns The root item Id. */ getRootItemParentID(sessionID: string): string; } diff --git a/TypeScript/9RouterHooks/types/services/ItemBaseClassService.d.ts b/TypeScript/9RouterHooks/types/services/ItemBaseClassService.d.ts index 9c6e6c8..a7d986b 100644 --- a/TypeScript/9RouterHooks/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/9RouterHooks/types/services/ItemBaseClassService.d.ts @@ -1,6 +1,6 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; /** * Cache the baseids for each item in the tiems db inside a dictionary @@ -8,11 +8,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; export declare class ItemBaseClassService { protected logger: ILogger; protected localisationService: LocalisationService; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected itemBaseClassesCache: Record; protected items: Record; protected cacheGenerated: boolean; - constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, localisationService: LocalisationService, databaseService: DatabaseService); /** * Create cache and store inside ItemBaseClassService * Store a dict of an items tpl to the base classes it and its parents have diff --git a/TypeScript/9RouterHooks/types/services/MailSendService.d.ts b/TypeScript/9RouterHooks/types/services/MailSendService.d.ts index 176e5f8..d445841 100644 --- a/TypeScript/9RouterHooks/types/services/MailSendService.d.ts +++ b/TypeScript/9RouterHooks/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -99,7 +99,7 @@ export declare class MailSendService { * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed @@ -125,5 +125,5 @@ export declare class MailSendService { * @param messageDetails * @returns gets an id of the individual sending it */ - protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string | undefined; } diff --git a/TypeScript/9RouterHooks/types/services/PaymentService.d.ts b/TypeScript/9RouterHooks/types/services/PaymentService.d.ts index 8d77ae2..64ff2c1 100644 --- a/TypeScript/9RouterHooks/types/services/PaymentService.d.ts +++ b/TypeScript/9RouterHooks/types/services/PaymentService.d.ts @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; } diff --git a/TypeScript/9RouterHooks/types/services/PmcChatResponseService.d.ts b/TypeScript/9RouterHooks/types/services/PmcChatResponseService.d.ts index cc172c0..613e5f3 100644 --- a/TypeScript/9RouterHooks/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/9RouterHooks/types/services/PmcChatResponseService.d.ts @@ -41,7 +41,7 @@ export declare class PmcChatResponseService { * @param pmcData Player profile * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player diff --git a/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts b/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts index 18da0c0..525b867 100644 --- a/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts +++ b/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts @@ -14,7 +14,7 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -24,6 +24,7 @@ import { Watermark } from "@spt/utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected databaseService: DatabaseService; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; @@ -33,12 +34,11 @@ export declare class ProfileFixerService { protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected cloner: ICloner; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, databaseServer: DatabaseServer, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -115,7 +115,7 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -187,7 +187,7 @@ export declare class ProfileFixerService { protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's null + * Resolve this by setting the nextResupply to 0 if it's undefined */ protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/9RouterHooks/types/services/ProfileSnapshotService.d.ts b/TypeScript/9RouterHooks/types/services/ProfileSnapshotService.d.ts index 5bb718b..4492dda 100644 --- a/TypeScript/9RouterHooks/types/services/ProfileSnapshotService.d.ts +++ b/TypeScript/9RouterHooks/types/services/ProfileSnapshotService.d.ts @@ -15,7 +15,7 @@ export declare class ProfileSnapshotService { * @param sessionID key * @returns A player profile object */ - getProfileSnapshot(sessionID: string): ISptProfile; + getProfileSnapshot(sessionID: string): ISptProfile | undefined; /** * Does a profile exists against the provided key * @param sessionID key diff --git a/TypeScript/9RouterHooks/types/services/RagfairOfferService.d.ts b/TypeScript/9RouterHooks/types/services/RagfairOfferService.d.ts index 04d5265..c044f6d 100644 --- a/TypeScript/9RouterHooks/types/services/RagfairOfferService.d.ts +++ b/TypeScript/9RouterHooks/types/services/RagfairOfferService.d.ts @@ -34,8 +34,8 @@ export declare class RagfairOfferService { * @returns IRagfairOffer array */ getOffers(): IRagfairOffer[]; - getOfferByOfferId(offerId: string): IRagfairOffer; - getOffersOfType(templateId: string): IRagfairOffer[]; + getOfferByOfferId(offerId: string): IRagfairOffer | undefined; + getOffersOfType(templateId: string): IRagfairOffer[] | undefined; addOffer(offer: IRagfairOffer): void; addOfferToExpired(staleOffer: IRagfairOffer): void; /** diff --git a/TypeScript/9RouterHooks/types/services/RaidTimeAdjustmentService.d.ts b/TypeScript/9RouterHooks/types/services/RaidTimeAdjustmentService.d.ts index e2a4237..f770b64 100644 --- a/TypeScript/9RouterHooks/types/services/RaidTimeAdjustmentService.d.ts +++ b/TypeScript/9RouterHooks/types/services/RaidTimeAdjustmentService.d.ts @@ -56,5 +56,5 @@ export declare class RaidTimeAdjustmentService { * @param newRaidTimeMinutes How long raid is in minutes * @returns List of exit changes to send to client */ - protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[]; + protected getExitAdjustments(mapBase: ILocationBase, newRaidTimeMinutes: number): ExtractChange[] | undefined; } diff --git a/TypeScript/9RouterHooks/types/services/SeasonalEventService.d.ts b/TypeScript/9RouterHooks/types/services/SeasonalEventService.d.ts index 4162e14..2353e4e 100644 --- a/TypeScript/9RouterHooks/types/services/SeasonalEventService.d.ts +++ b/TypeScript/9RouterHooks/types/services/SeasonalEventService.d.ts @@ -10,13 +10,13 @@ import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISe import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { DatabaseImporter } from "@spt/utils/DatabaseImporter"; export declare class SeasonalEventService { protected logger: ILogger; - protected databaseServer: DatabaseServer; + protected databaseService: DatabaseService; protected databaseImporter: DatabaseImporter; protected giftService: GiftService; protected localisationService: LocalisationService; @@ -27,11 +27,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; - protected halloweenEventActive: boolean; - protected christmasEventActive: boolean; + protected halloweenEventActive?: boolean; + protected christmasEventActive?: boolean; /** All events active at this point in time */ protected currentlyActiveEvents: SeasonalEventType[]; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** diff --git a/TypeScript/9RouterHooks/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/9RouterHooks/types/services/TraderPurchasePersisterService.d.ts index 0ad76c9..6bef9f5 100644 --- a/TypeScript/9RouterHooks/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/9RouterHooks/types/services/TraderPurchasePersisterService.d.ts @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/TypeScript/9RouterHooks/types/services/mod/CustomItemService.d.ts b/TypeScript/9RouterHooks/types/services/mod/CustomItemService.d.ts index 0c82e8b..6dc4730 100644 --- a/TypeScript/9RouterHooks/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/9RouterHooks/types/services/mod/CustomItemService.d.ts @@ -1,21 +1,19 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; -import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; - protected databaseServer: DatabaseServer; + protected databaseServer: DatabaseService; protected itemHelper: ItemHelper; protected itemBaseClassService: ItemBaseClassService; protected cloner: ICloner; - protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseService, itemHelper: ItemHelper, itemBaseClassService: ItemBaseClassService, cloner: ICloner); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start diff --git a/TypeScript/9RouterHooks/types/utils/HttpResponseUtil.d.ts b/TypeScript/9RouterHooks/types/utils/HttpResponseUtil.d.ts index 865c8e5..ff84544 100644 --- a/TypeScript/9RouterHooks/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/9RouterHooks/types/utils/HttpResponseUtil.d.ts @@ -22,8 +22,8 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; - getUnclearedBody(data: any, err?: number, errmsg?: any): string; + getBody(data: T, err?: number, errmsg?: string, sanitize?: boolean): IGetBodyResponseData; + getUnclearedBody(data: any, err?: number, errmsg?: string): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; emptyArrayResponse(): IGetBodyResponseData; diff --git a/TypeScript/9RouterHooks/types/utils/JsonUtil.d.ts b/TypeScript/9RouterHooks/types/utils/JsonUtil.d.ts index b59b0f9..f364db5 100644 --- a/TypeScript/9RouterHooks/types/utils/JsonUtil.d.ts +++ b/TypeScript/9RouterHooks/types/utils/JsonUtil.d.ts @@ -6,7 +6,7 @@ export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; protected logger: ILogger; - protected fileHashes: any; + protected fileHashes?: Map; protected jsonCacheExists: boolean; protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); @@ -32,15 +32,15 @@ export declare class JsonUtil { * @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; - serializeJson5(data: any, filename?: string | null, prettify?: boolean): string; + serializeJsonC(data: any, filename?: string | undefined, options?: IStringifyOptions | Reviver): string | undefined; + serializeJson5(data: any, filename?: string | undefined, prettify?: boolean): string | undefined; /** * 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; + deserialize(jsonString: string, filename?: string): T | undefined; /** * From string to object * @param jsonString json string to turn into object @@ -48,16 +48,16 @@ export declare class JsonUtil { * @param options Parsing options * @returns object */ - deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; - deserializeJson5(jsonString: string, filename?: string): T; - deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T | undefined; + deserializeJson5(jsonString: string, filename?: string): T | undefined; + 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; + deserializeWithCacheCheck(jsonString: string, filePath: string): T | undefined; /** * Create file if nothing found * @param jsonCachePath path to cache diff --git a/TypeScript/9RouterHooks/types/utils/MathUtil.d.ts b/TypeScript/9RouterHooks/types/utils/MathUtil.d.ts index 4acfeaf..fdf9a17 100644 --- a/TypeScript/9RouterHooks/types/utils/MathUtil.d.ts +++ b/TypeScript/9RouterHooks/types/utils/MathUtil.d.ts @@ -49,5 +49,5 @@ export declare class MathUtil { * @param {array} y support points in y (of same length as x) * @return {number} y(xp) */ - interp1(xp: number, x: number[], y: number[]): number; + interp1(xp: number, x: number[], y: number[]): number | undefined; } diff --git a/TypeScript/9RouterHooks/types/utils/RagfairOfferHolder.d.ts b/TypeScript/9RouterHooks/types/utils/RagfairOfferHolder.d.ts index 20f54a9..71cb4aa 100644 --- a/TypeScript/9RouterHooks/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/9RouterHooks/types/utils/RagfairOfferHolder.d.ts @@ -1,15 +1,17 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { protected maxOffersPerTemplate: number; protected ragfairServerHelper: RagfairServerHelper; + protected profileHelper: ProfileHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); - getOfferById(id: string): IRagfairOffer; - getOffersByTemplate(templateId: string): Array; - getOffersByTrader(traderId: string): Array; + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper); + getOfferById(id: string): IRagfairOffer | undefined; + getOffersByTemplate(templateId: string): Array | undefined; + getOffersByTrader(traderId: string): Array | undefined; getOffers(): Array; addOffers(offers: Array): void; addOffer(offer: IRagfairOffer): void; diff --git a/TypeScript/9RouterHooks/types/utils/RandomUtil.d.ts b/TypeScript/9RouterHooks/types/utils/RandomUtil.d.ts index 1cee659..49f242d 100644 --- a/TypeScript/9RouterHooks/types/utils/RandomUtil.d.ts +++ b/TypeScript/9RouterHooks/types/utils/RandomUtil.d.ts @@ -44,7 +44,7 @@ export declare class ProbabilityObjectArray extends Array extends Array { key: K; relativeProbability: number; - data: V; + data?: V; /** * Constructor for the ProbabilityObject * @param {string} key The key of the element diff --git a/TypeScript/9RouterHooks/types/utils/TimeUtil.d.ts b/TypeScript/9RouterHooks/types/utils/TimeUtil.d.ts index 2b844ba..6c14b9d 100644 --- a/TypeScript/9RouterHooks/types/utils/TimeUtil.d.ts +++ b/TypeScript/9RouterHooks/types/utils/TimeUtil.d.ts @@ -42,6 +42,11 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + /** + * Get timestamp of today + passed in day count + * @param daysFromNow Days from now + */ + getTimeStampFromNowDays(daysFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * diff --git a/TypeScript/9RouterHooks/types/utils/VFS.d.ts b/TypeScript/9RouterHooks/types/utils/VFS.d.ts index 20f428a..6287a2f 100644 --- a/TypeScript/9RouterHooks/types/utils/VFS.d.ts +++ b/TypeScript/9RouterHooks/types/utils/VFS.d.ts @@ -9,7 +9,7 @@ export declare class VFS { copyFilePromisify: (src: fs.PathLike, dst: fs.PathLike, flags?: number) => Promise; mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; - }) => Promise; + }) => Promise; readFilePromisify: (path: fs.PathLike) => Promise; writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { @@ -49,7 +49,7 @@ export declare class VFS { protected lockFileSync(filepath: any): () => void; protected checkFileSync(filepath: any): boolean; protected unlockFileSync(filepath: any): void; - getFileExtension(filepath: string): string; + getFileExtension(filepath: string): string | undefined; stripExtension(filepath: string): string; minifyAllJsonInDirRecursive(filepath: string): Promise; minifyAllJsonInDirRecursiveAsync(filepath: string): Promise; diff --git a/TypeScript/9RouterHooks/types/utils/Watermark.d.ts b/TypeScript/9RouterHooks/types/utils/Watermark.d.ts index 27b5b03..947ff19 100644 --- a/TypeScript/9RouterHooks/types/utils/Watermark.d.ts +++ b/TypeScript/9RouterHooks/types/utils/Watermark.d.ts @@ -16,11 +16,11 @@ export declare class Watermark { protected logger: ILogger; protected configServer: ConfigServer; protected localisationService: LocalisationService; - protected watermarkLocale?: WatermarkLocale; + protected watermarkLocale: WatermarkLocale; protected sptConfig: ICoreConfig; protected text: string[]; protected versionLabel: string; - constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale?: WatermarkLocale); + constructor(logger: ILogger, configServer: ConfigServer, localisationService: LocalisationService, watermarkLocale: WatermarkLocale); initialize(): void; /** * Get a version string (x.x.x) or (x.x.x-BLEEDINGEDGE) OR (X.X.X (18xxx)) diff --git a/TypeScript/9RouterHooks/types/utils/collections/lists/LinkedList.d.ts b/TypeScript/9RouterHooks/types/utils/collections/lists/LinkedList.d.ts index 6a084fa..3c35a5a 100644 --- a/TypeScript/9RouterHooks/types/utils/collections/lists/LinkedList.d.ts +++ b/TypeScript/9RouterHooks/types/utils/collections/lists/LinkedList.d.ts @@ -20,35 +20,35 @@ export declare class LinkedList { /** * Returns the first element's value. */ - getHead(): T; + getHead(): T | undefined; /** * Finds the element from the list at the given index and returns it's value. */ - get(idx: number): T; + get(idx: number): T | undefined; /** * Returns the last element's value. */ - getTail(): T; + getTail(): T | undefined; /** * Finds and removes the first element from a list that has a value equal to the given value, returns it's value if it successfully removed it. */ - remove(value: T): T; + remove(value: T): T | undefined; /** * Removes the first element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - shift(): T; + shift(): T | undefined; /** * Removes the element from the list at the given index and returns it's value. */ - removeAt(idx: number): T; + removeAt(idx: number): T | undefined; /** * Removes the last element from the list and returns it's value. If the list is empty, undefined is returned and the list is not modified. */ - pop(): T; + pop(): T | undefined; /** * Returns an iterable of index, value pairs for every entry in the list. */ - entries(): IterableIterator<[number, T]>; + entries(): IterableIterator<[number, T | undefined]>; /** * Returns an iterable of values in the list. */ diff --git a/TypeScript/9RouterHooks/types/utils/collections/queue/Queue.d.ts b/TypeScript/9RouterHooks/types/utils/collections/queue/Queue.d.ts index 8ea3d32..80514f4 100644 --- a/TypeScript/9RouterHooks/types/utils/collections/queue/Queue.d.ts +++ b/TypeScript/9RouterHooks/types/utils/collections/queue/Queue.d.ts @@ -13,9 +13,9 @@ export declare class Queue { /** * Removes the first element from the queue and returns it's value. If the queue is empty, undefined is returned and the queue is not modified. */ - dequeue(): T; + dequeue(): T | undefined; /** * Returns the first element's value. */ - peek(): T; + peek(): T | undefined; }